Add resource-oriented v2 APIs for Basic Auth users and RBAC roles/permissions #4916
All Vouch review confidence checks passed
Residual risk 0.42 = Change Risk (0.75) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 412 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.360
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #4916"
general
weight: 0.35
sarkaramrit1993
Summary
Solr's existing v2 security endpoints (
/api/cluster/security/authentication,/api/cluster/security/authorization) are command-batch-over-POST — the sameset-user/set-permission/etc. commands as v1, just reachable at a v2 URL, not genuine resource-oriented REST. This PR adds a real resource-oriented v2 surface alongside the existing one, following the same JAX-RS/Jersey pattern already used byClusterPropertyApis/AliasPropertyApis:GET/PUT/DELETE /api/cluster/security/authentication/{scheme}/users/{username}GET/PUT/DELETE /api/cluster/security/authorization/{scheme}/roles/{username}GET/POST/PUT/DELETE /api/cluster/security/authorization/permissions/{index}The
{scheme}path segment lets these APIs work correctly underMultiAuthPlugin/MultiAuthRuleBasedAuthorizationPlugin(routing to the right sub-plugin's config), and is simply ignored for a plainBasicAuthPlugin/RuleBasedAuthorizationPluginsetup. Permissions have no such segment —MultiAuthRuleBasedAuthorizationPlugin.edit()already treats every*-permissioncommand as shared across all schemes rather than per-scheme, so no wrapping is needed there.All mutations still funnel through
SecurityConfHandler's existingCommandOperation/ConfigEditablePluginmachinery (extracted here into a new publiceditSecurityConfig()shared with the legacy v1/v2 command endpoints) — this is additive REST surface, not a rewrite of the security model orsecurity.jsonsemantics.Also included:
security.js/services.js) to the new endpoints for user/role create/update/delete, following the existingAliasesV2-style generated-client pattern.basic-authentication-plugin.adoc,rule-based-authorization-plugin.adoc).rule-based-authorization-plugin.adocwas missing v2 URL examples for the existing command-batch authorization commands.Test plan
SecurityV2ApiStandaloneTest— standalone-mode HTTP tests for all three resources via the generated SolrJ client (create/list/update/delete, including 401/404/409 error cases)SecurityV2ApiCloudTest— SolrCloud-mode coverage; also catches and regression-tests aClassCastExceptionfound via manual testing (Utils.getDeepCopy(..., mutable=false)wraps nested lists inCollections.unmodifiableCollection, notunmodifiableList, on the ZK-cached read path)MultiAuthUsersAndRolesApiCloudTest— a genuine 2-schemeMultiAuthPlugin/MultiAuthRuleBasedAuthorizationPlugincluster proving users/roles written to one scheme never leak into anotherSecurityConfHandlerTest,V2SecurityAPIMappingTest,BasicAuthStandaloneTest,MultiAuthPluginTest,BasicAuthOnSingleNodeTest) pass unchanged./gradlew spotlessCheck forbiddenApisMainclean./gradlew :solr:solr-ref-guide:checkSite)🤖 Generated with Claude Code
https://claude.ai/code/session_01Kapco1bnqFBMkFHFPF6MFL