Copilot commented on code in PR #4534:
URL: https://github.com/apache/solr/pull/4534#discussion_r3426796227
##########
solr/core/src/java/org/apache/solr/cli/AuthTool.java:
##########
@@ -284,8 +295,20 @@ private void handleBasicAuth(CommandLine cli) throws
Exception {
updateIncludeFileEnableAuth(includeFile, basicAuthConfFile);
final String successMessage =
String.format(
- Locale.ROOT, "Successfully enabled basic auth with username
[%s].", username);
+ Locale.ROOT,
+ "Successfully enabled basic auth with username [%s] assigned
to all roles (superadmin, admin, index, search).",
+ username);
echo(successMessage);
+ if (!updateIncludeFileOnly) {
+ CLIO.out(
+ "\nIMPORTANT: The following template users have been created
with NO password set"
+ + " and cannot log in until passwords are assigned:");
+ CLIO.out(" - admin (roles: admin, index, search)");
+ CLIO.out(" - index (roles: index, search)");
+ CLIO.out(" - search (roles: search)");
+ CLIO.out(
+ "Set their passwords using the Admin UI Security page or the
authentication API.");
+ }
Review Comment:
This message says the template users (admin/index/search) have NO password
set, but if the operator chose one of those usernames with --credentials then
that specific account will have a password. Consider excluding the bootstrap
username from the reminder list (or adjusting the wording) to avoid misleading
output.
##########
solr/webapp/web/js/angular/controllers/security.js:
##########
@@ -412,6 +412,12 @@ solrAdminApp.controller('SecurityController', function
($scope, $timeout, $cooki
return false;
}
+ var username = $scope.upsertUser.username ?
$scope.upsertUser.username.trim() : "";
+ if (password === username) {
+ $scope.validationError = "Password must not be the same as the username";
+ return false;
+ }
Review Comment:
The Admin UI now hard-rejects password == username unconditionally, which
prevents the new server-side escape hatch
(solr.security.auth.basicauth.allowuseraspassword) from working via the UI.
Since the UI can’t know whether the server has the escape hatch enabled, it
should not enforce this rule client-side (let the server accept/reject).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]