-
-
Notifications
You must be signed in to change notification settings - Fork 238
feat: allow any authentication provider + fief OIDC #999
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
base: master
Are you sure you want to change the base?
Conversation
|
do we need multiple auth providers ? |
Thanks for the comment @prmths128 ! I agree we won't need 2 auth providers ever at the same time. On the other hand if we can implement the fastapi_oidc so that the server is injected and easily plugable? Like that for local dev we inject a mock and it is easier to work with it. What do you think? |
SaboniAmine
left a comment
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.
LGTM, thanks!
| ) # Options: 'oidc', 'fief' (deprecated), 'none' | ||
|
|
||
| # OIDC settings (with backward compatibility for Fief environment variables) | ||
| oidc_client_id: str = "" |
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.
lets maybe source from env vars with default values ?
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.
It is in the config part. I did it like this because we need to still read the FIEF_... env vars.
So in this configuration:
https://github.com/mlco2/codecarbon/pull/999/changes#diff-24a79c91033797e992d55fd4eddbcda1cff587119f27fe3cd7d2c739bb616ab8R43
The precedence is:
- First checks OIDC_CLIENT_ID
- If not found, then checks FIEF_CLIENT_ID
- If neither found, uses the default value (empty string "")
Description
Instead of using directly Fief, we can pass an auth_provider interface that uses OIDC and points to Fief.
Two main gains:
auth_providerinterface.carbonserver/carbonserver/api/services/auth_providers/no_auth_provider.py, for testing purposes. This will allow the UI in local to be easier to test/develop.Related to #861