Aman-Mittal commented on code in PR #173:
URL: 
https://github.com/apache/fineract-loan-origination/pull/173#discussion_r4385571511


##########
src/main/resources/META-INF/licenses/SecLists-SOURCE.txt:
##########
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+Resource: common-passwords.txt

Review Comment:
   **Blocking: the licence declaration needs to be at the top level too.** The 
provenance file is good, but ASF release policy expects bundled third-party 
content to be listed in the top-level licence file. Today `LICENSE.md` is just 
the Apache 2.0 text, and the repo has no `NOTICE`.
   
   Please append a third-party section to `LICENSE.md`, e.g. "This product 
bundles `src/main/resources/common-passwords.txt` from SecLists 
(https://github.com/danielmiessler/SecLists), licensed under the MIT License; 
see `src/main/resources/META-INF/licenses/SecLists-LICENSE.txt`."
   
   The upstream file (`100k-most-used-passwords-NCSC.txt`) is a compilation 
published by the UK NCSC, which SecLists redistributes. It's worth a line on 
dev@ confirming the MIT grant covers it, since this would be the first bundled 
data file in the project.



##########
src/main/java/org/apache/fineract/los/api/AdminStaffController.java:
##########
@@ -64,7 +64,7 @@ public class AdminStaffController {
 
   public record CreateStaffRequest(
       @NotBlank String username,
-      @NotBlank @Size(min = 8, message = "Password must be at least 8 
characters") String password,
+      @NotBlank String password,

Review Comment:
   **Blocking: the update path skips the new policy.** Create now goes through 
`PasswordValidator`, but `UpdateStaffRequest` (L80) still has only `@Size(min = 
8)`, and `StaffManagementService.updateStaff` (L122) does 
`staff.setPasswordHash(passwordEncoder.encode(plainPassword))` without 
validating. So `PATCH /admin/staff/{id}` with `{"password": "password"}` or the 
staff username succeeds, defeating the 12-character, blocklist and 
username/email rules.
   
   Please call `passwordValidator.validate(plainPassword, staff.getUsername(), 
email != null ? email : staff.getEmail())` in `updateStaff` when a password is 
supplied, throw `WeakPasswordException` on failure, and drop the stale 
`@Size(min = 8)` on L80. Please also add a service test and an API test for the 
update path, like the create ones.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to