Skip to content
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

feat(api) add fief auth layer #603

Merged
merged 1 commit into from
Jul 11, 2024
Merged

feat(api) add fief auth layer #603

merged 1 commit into from
Jul 11, 2024

Conversation

prmths128
Copy link
Contributor

@prmths128 prmths128 commented Jul 6, 2024

First version.

Adds settings and auth layer for fief.
Still a bit experimental, it will have to be challenged once the dust settles but it works.

More than one auth strategies implemented.
It's meant to allow authentication through web page (using cookie), or web app (using token).
The token strategy is also meant as a test for API token auth later (that part could be discussed).

I also added a dependency (not used in this PR) to reconciliate user profiles between fief and the app DB.
Using the dependency in a router ensures the user is authenticated by fief and present in the local DB so we can then check permissions.

@prmths128 prmths128 requested review from SaboniAmine and inimaz and removed request for SaboniAmine July 6, 2024 08:02
Copy link
Contributor

@inimaz inimaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good @prmths128 ! Once you feel it's ready maybe you can do a small demo of the authentication flow? Looks very promising!

carbonserver/carbonserver/api/routers/authenticate.py Outdated Show resolved Hide resolved
@inimaz inimaz added the API Concern only the codecarbon API label Jul 6, 2024
@prmths128 prmths128 marked this pull request as ready for review July 8, 2024 19:16
@prmths128 prmths128 force-pushed the feat/fief_authentication branch 2 times, most recently from 3a0295f to 40976ad Compare July 8, 2024 19:44
@prmths128 prmths128 requested a review from inimaz July 9, 2024 17:44
@prmths128 prmths128 merged commit a9e857a into master Jul 11, 2024
8 checks passed
@prmths128 prmths128 deleted the feat/fief_authentication branch July 11, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Concern only the codecarbon API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants