Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authorize rest requests (opensearch-project#2753)
* WIP on rest layer authz Signed-off-by: Craig Perkins <[email protected]> * WIP on rest-layer authz Signed-off-by: Craig Perkins <[email protected]> * Extension handshake Signed-off-by: Craig Perkins <[email protected]> * Extension TLS Signed-off-by: Craig Perkins <[email protected]> * Remove SecurityRestFilterChanges to isolate extension TLS change Signed-off-by: Craig Perkins <[email protected]> * Remove SecurityRestFilterChanges to isolate extension TLS change Signed-off-by: Craig Perkins <[email protected]> * Remove SecurityRestFilterChanges to isolate extension TLS change Signed-off-by: Craig Perkins <[email protected]> * Remove SecurityRestFilterChanges to isolate extension TLS change Signed-off-by: Craig Perkins <[email protected]> * Remove SecurityRestFilterChanges to isolate extension TLS change Signed-off-by: Craig Perkins <[email protected]> * WIP for HelloWorld sample extension role Signed-off-by: Craig Perkins <[email protected]> * Initial implementation of authz check in REST layer Signed-off-by: Craig Perkins <[email protected]> * Remove header Signed-off-by: Craig Perkins <[email protected]> * Create authorizeRequest method Signed-off-by: Craig Perkins <[email protected]> * small fix Signed-off-by: Craig Perkins <[email protected]> * Change to ProtectedRoute Signed-off-by: Craig Perkins <[email protected]> * Remove extension permissions Signed-off-by: Craig Perkins <[email protected]> * Initial implementation of authz check in REST layer Signed-off-by: Craig Perkins <[email protected]> * Extension TLS Signed-off-by: Craig Perkins <[email protected]> * Adds dummy roles for testing rest authorization against legacy permissions Signed-off-by: Darshit Chanpura <[email protected]> * Adds support for legacy permissions to perform rest authorization Signed-off-by: Darshit Chanpura <[email protected]> * Fixes white-space changes Signed-off-by: Darshit Chanpura <[email protected]> * Rebases ConfigConstants with main Signed-off-by: Darshit Chanpura <[email protected]> * Implements a new logic for rest permissions check to be more flexible Signed-off-by: Darshit Chanpura <[email protected]> * Fixes spotless errors Signed-off-by: Darshit Chanpura <[email protected]> * Adds regex to match against current role permissions when comparing new permission with legacy ones Signed-off-by: Darshit Chanpura <[email protected]> * Moves legacy permission check logic to ConfigModelV7 Signed-off-by: Darshit Chanpura <[email protected]> * Fixes extra new-lines Signed-off-by: Darshit Chanpura <[email protected]> * Fixes unused imports Signed-off-by: Darshit Chanpura <[email protected]> * Fixes out-of-scope white space changes Signed-off-by: Darshit Chanpura <[email protected]> * Fixes code-ql errors Signed-off-by: Darshit Chanpura <[email protected]> * Fixes spotless and code-ql errors Signed-off-by: Darshit Chanpura <[email protected]> * Fixes variable name and remove references to whitelist in javadoc Signed-off-by: Darshit Chanpura <[email protected]> * Adds tests for rest layer privilege evaluator Signed-off-by: Darshit Chanpura <[email protected]> * Adds license header to the test file Signed-off-by: Darshit Chanpura <[email protected]> * Updates zstd dependency to fetch from core version.properties Signed-off-by: Darshit Chanpura <[email protected]> * Updates action name in the regex to be dynamic Signed-off-by: Darshit Chanpura <[email protected]> * Adds support for allowing evaluation against multiple actions names for a registered named route Signed-off-by: Darshit Chanpura <[email protected]> * Updates tests Signed-off-by: Darshit Chanpura <[email protected]> * Adds null check Signed-off-by: Darshit Chanpura <[email protected]> * Makes authorize logic clearer to follow Signed-off-by: Darshit Chanpura <[email protected]> * Adds extra check to ensure new actions are also evaluated against transport actions Signed-off-by: Darshit Chanpura <[email protected]> * Fixes spotless errors Signed-off-by: Darshit Chanpura <[email protected]> * Fixes security rest filter setup Signed-off-by: Darshit Chanpura <[email protected]> * Removes extension reference Signed-off-by: Darshit Chanpura <[email protected]> * turn on audit logging Signed-off-by: Maciej Mierzwa <[email protected]> * Adds unit tests for restPathMatches method Signed-off-by: Darshit Chanpura <[email protected]> * Cleans up TODOs Signed-off-by: Darshit Chanpura <[email protected]> * Organizes demo users and roles for extension Signed-off-by: Darshit Chanpura <[email protected]> * Address PR feedback Signed-off-by: Darshit Chanpura <[email protected]> * Adds more comments Signed-off-by: Darshit Chanpura <[email protected]> * add privileges info Signed-off-by: Maciej Mierzwa <[email protected]> * Makes whoami action a named route and fixes license header check Signed-off-by: Darshit Chanpura <[email protected]> * Adds integ tests for whoami route Signed-off-by: Darshit Chanpura <[email protected]> * Change permissions order in roles.yml Signed-off-by: Darshit Chanpura <[email protected]> * Adds developer documentation for authorization in REST layer Signed-off-by: Darshit Chanpura <[email protected]> * Fixes broken tests Signed-off-by: Darshit Chanpura <[email protected]> * Fixes checkstyle errors Signed-off-by: Darshit Chanpura <[email protected]> * Addresses feedback and cleans up logic for super admin check Signed-off-by: Darshit Chanpura <[email protected]> * Addresses Plugin Install CI failure Signed-off-by: Darshit Chanpura <[email protected]> * Fixes failing citest task Signed-off-by: Darshit Chanpura <[email protected]> * Modifies WhoAmI integ tests Signed-off-by: Darshit Chanpura <[email protected]> * Adds a new endpoint called whoamiprotected and removes changes made to whoami route Signed-off-by: Darshit Chanpura <[email protected]> * Updates documentation to reflect the new API Signed-off-by: Darshit Chanpura <[email protected]> * Addresses PR feedback Signed-off-by: Darshit Chanpura <[email protected]> * Renames action0 to actions Signed-off-by: Darshit Chanpura <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Darshit Chanpura <[email protected]> Signed-off-by: Maciej Mierzwa <[email protected]> Co-authored-by: Craig Perkins <[email protected]> Co-authored-by: MaciejMierzwa <[email protected]>
- Loading branch information