sarkaramrit1993 commented on PR #5320: URL: https://github.com/apache/solr/pull/5320#issuecomment-6868395253
Thanks @nick-boss-tech. I checked whether v2 needs [your follow-up](https://github.com/nick-boss-tech/solr/compare/5fa5513038a7cf9318ed800423d8a44064d4c0e3...b4bb017d22c036df50bebfffecf26c0e8a0b0b57) and it doesn't. **What already works on [the current head](https://github.com/apache/solr/commit/5fa5513038a7cf9318ed800423d8a44064d4c0e3) without it** These behave the same over `/api/cluster/security/authorization` as over `/admin/authorization`: - `update-permission` by `id` - `delete-permission` by `id`, and by index as before - `set-permission` with a stored permission sent back as is, `id` and `index` included **Why** - The v2 POST isn't checked against the command schema, because [`SecurityConfHandler` reads commands without validators](https://github.com/apache/solr/blob/5fa5513038a7cf9318ed800423d8a44064d4c0e3/solr/core/src/java/org/apache/solr/handler/admin/SecurityConfHandler.java#L119). - Input is checked by [`AutorizationEditOperation`](https://github.com/apache/solr/blob/5fa5513038a7cf9318ed800423d8a44064d4c0e3/solr/core/src/java/org/apache/solr/security/AutorizationEditOperation.java#L83), which [already accepts `id`](https://github.com/apache/solr/blob/5fa5513038a7cf9318ed800423d8a44064d4c0e3/solr/core/src/java/org/apache/solr/security/AutorizationEditOperation.java#L197). - Your endpoint test passes on this branch, except for the assertion on `anyOf`. **What the follow-up changes** - Only what the spec describes. [`delete-permission` is still declared as an integer](https://github.com/apache/solr/blob/5fa5513038a7cf9318ed800423d8a44064d4c0e3/solr/core/src/java/org/apache/solr/handler/admin/api/ModifyRuleBasedAuthConfigAPI.java#L53) there, but nothing enforces it. - Adding `anyOf` to `JsonSchemaValidator` for that is more surface than this PR should carry, so I'm leaving it out. - The stale spec can be fixed with [the v2 security resource APIs](https://github.com/apache/solr/pull/4916). -- 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]
