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

Add middleware to pull out auth state from the JWT. #183

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

jklein24
Copy link
Contributor

Also refactoring the frontend's API to a blueprint for better modularization in the process.

Copy link
Contributor Author

jklein24 commented Sep 30, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @jklein24 and the rest of your teammates on Graphite Graphite

Copy link
Contributor

@dawit-0 dawit-0 left a comment

Choose a reason for hiding this comment

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

awesome!



def create_app() -> Quart:
app: Quart = Quart(__name__)
app.request_class = UmaAuthRequest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yunyuyunyu let me know if there's a more correct way to do this. I feel like I'm missing something because I still need to cast to this type in wrappers.py. Not sure if I'm actually getting the benefit of this line as a result.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't set it, in require_auth the request you are getting most likely will not be a UmaAuthRequest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does seem to be working for me in unit tests and when running locally, so I think this is right?

@jklein24 jklein24 changed the title Add middlewear to pull out auth state from the JWT. Add middleware to pull out auth state from the JWT. Sep 30, 2024
@jklein24 jklein24 changed the base branch from fix/hashrefresh to graphite-base/183 September 30, 2024 22:03


def create_app() -> Quart:
app: Quart = Quart(__name__)
app.request_class = UmaAuthRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't set it, in require_auth the request you are getting most likely will not be a UmaAuthRequest

@jklein24 jklein24 changed the base branch from graphite-base/183 to main October 1, 2024 17:51
@jklein24 jklein24 merged commit 0cb468f into main Oct 1, 2024
5 checks passed
@jklein24 jklein24 deleted the feat/authmiddle branch October 1, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants