-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Hack Casbin RBAC in for POC * Fix issue with apigroup-core.yml * Externalise casbin adapter * Load in some default builtin roles (always) * General improvements to the code - Better error handling - Renaming of some properties - Renaming of API mappings file - Use keyMatch in rbac-model.conf to allow wildcards - Fix import order - Rename mapping endpoint - Remove unused bolt bucket * Make the endpoint_enforcer.go generic and add tests * Introduce some REST handlers and allow/deny effect * Introduce some REST handlers and allow/deny effect * Add pkger and mocked endpoint_enforcer tests * Static file and dependency improvements * Use rice instead of pkger * Move enforcer instantiation to server.go * Fix makefile issue * Unit test the new handlers * Some improvements including some from the CR * Updated our bolt dependency (the adapter is supporting latest - so makes sense to bump us too) * Log errors in handlers and correct wrap errors * Improve static rbac-policy.csv * Make the rbac-api-mappings.yml more flexible & user friendly * We now load in a different file format at start up for the RBAC api mappings. This one is more flexible, and I believe more user friendly (see the comment in the .yml file). Once loaded, we still have an O(1) lookup available for the endpoints :) * Moved some models out of Gaia into rbac as they we only being used internally by the rbac package. * Add RBAC settings flag (enabled/disabled) and some improvements * Split the settings store interface out into its own (but nested in store.GaiaStore) * Added unit tests for settings.go and improved DI on existing ones * Created a new SettingsHandler to encapsulate the store dependency * Add ability to save RBAC enabled state into database * RBAC service is switched to EnforcerService or NoOpService depeneding on enabled state * RBAC can be enabled or disabled with cmd flag `-rbac-enabled=true/false` * Fix the import order * Code improvements * Fixed issues with missing or incorrect rbac-api-mappings.yml * Started some acceptance tests for RBAC (probably to be finished outside this PR - its a lot of work) * Added some tests for the content of the rbac-api-mappings.yml to alert us to any future change * Endpoint Enforce now returns a PermissionDenied error * Resolve conflicts * Omit rbac_endpoint_test.go (for now) and update rice.FindBox to be string literal See https://github.com/GeertJohan/go.rice/blob/master/README.md for why * Add some more unit tests * Fix enforcer logic and test assertions * Add flag for RBAC debugging logging * Refactor RBAC settings code * Fix all merge conflicts around settings.go * Couple of quick fixes post merge * Fix test and add missing pull route
- Loading branch information
Showing
35 changed files
with
2,245 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.