Allow multiple users and open read-only APIs to non-admins#600
Allow multiple users and open read-only APIs to non-admins#600benoit-nexthop wants to merge 6 commits intocloudbase:mainfrom
Conversation
- Remove Unlock call in handleScaleDown that was called before any lock was acquired - Change defer Unlock to immediate Unlock in consolidateRunnerState loop to avoid holding locks until function exit
- Add OIDC configuration to config.go with validation - Add OIDC provider integration with state management and token exchange - Add OIDC login/callback/status API endpoints - Update NewUserParams with IsSSOUser flag for SSO users without passwords - Consolidate CreateOIDCUser into CreateUser with IsSSOUser check - Add OIDC login button to webapp login page - Add OIDC tests and documentation
…endpoints - Remove restriction that prevented creating multiple admin users - Update AdminRequiredMiddleware to only require admin for POST/PUT/DELETE - GET/OPTIONS/HEAD requests now work for all authenticated users
…ers to view resources
|
Hi @benoit-nexthop, Thank you for having a look into enabling multi user support. This seems like a big change, which opens up a lot of API endpoints. While the very long term goal is to make GARM multi user capable, we need to do it in a way that allows true separation between user resources. These changes seem to allow users to be created, but I don't see changes made to the models that enables real multi user support for all resources. Would you mind opening a discussion and detailing what you would like to accomplish, a user story, a use case, etc. Changes of these scale should be discussed first, especially if they involve broad architectural changes to GARM itself. |
|
This isn't true multi user support but it does allow people in my organization to login with SSO and see the web UI of GARM in read-only mode. |
Summary
This PR enables multi-user support in GARM by allowing multiple admin users and relaxing admin requirements for read-only operations. This is particularly useful when combined with OIDC authentication, allowing SSO users to view resources without requiring admin privileges.
Changes
Allow multiple admin users
Relax admin requirement for read-only endpoints
AdminRequiredMiddlewareto only require admin for POST/PUT/DELETEIsAdminchecks from read-only operations in runner packageAdd user management
/api/v1/usersendpoint to list all usersRationale
Currently GARM only supports a single admin user, which makes it difficult to:
This change maintains security by still requiring admin privileges for any mutating operations.
Testing
Tested with OIDC authentication in staging and production environments.
This PR is part of a stack of changes: