-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document RBAC client implementation #1363
base: master
Are you sure you want to change the base?
Conversation
|
||
### Authentication Middleware | ||
|
||
The authentication middleware is responsible for verifying that the request has been made by a known party, and that said party's identity token has all the information necessary for identification of the concrete requester. It is implemented in the `auth` module and the `Authentication` function within the `auth_middleware.go` file. If enabled, authentication always happens before the authorization process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe wen can use a link to this file instead of just mentioning it
|
||
### Authorization Middleware | ||
|
||
The authorization middleware is responsible for enforcing role-based access control (RBAC) for incoming requests. It is implemented in the `auth` module and the `Authorization` function within the `auth_middleware.go` file. The authorization middleware is set up in the `setupAuthMiddleware` function, which configures the router to use the `Authorization` middleware for routes that require RBAC checks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve just realized auth_middleware may be misleading as it could refer to authorization or authentication, but I guess it’s not a big deal
#### Key Features: | ||
- **RBAC Enforcement**: The middleware checks if the user has the necessary permissions to access the requested resource. A configuration option, `enforce`, was added to the RBAC configuration in order to enforce or bypass RBAC. | ||
- **Bypass for Specific URLs**: Certain URLs can be configured to bypass authorization checks, allowing public access. | ||
- **User Agent Handling**: Requests from specific user agents (e.g. ACM) can bypass RBAC checks for now. This is a temporary solution that was agreed upon with them, as there is a lot more work related to service accounts configurations and RBAC roles definitions to do in order to ensure that this new functionality doesn't affect our internal API consumers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as we are keeping the user access as it is, is this AMS specific configuration still needed?
|
||
For the authorization middleware to take action when access is not authorized, the RBAC enforcement must be enabled. This is done by setting the `enforce` flag in the RBAC client configuration. | ||
- If enforcement is not enabled, the middleware will not block access even if the user is not authorized. | ||
- For now, anything decision taken by the authorization middleware is logged, with the hope to get more information on customers' readiness and make future development easier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything -> any
Description
Document for RBAC client implementation
Part of CCXDEV-12884
Type of change
Testing steps
N/A
Checklist
make before_commit
passes