-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Axum example #247
Comments
Sounds good! I'll try to find some time to review it if you submit a PR adding the contributed example link. |
@ikehz, would love to see your example if you've time. |
I have added an axum example for 5.0.0-alpha.4. I find the addition of type states made it a mess, I wonder how should I pass around the type next time. struct AppState {
client: BasicClient<EndpointSet, EndpointNotSet, EndpointNotSet, EndpointSet, EndpointSet>,
...
} |
I'd suggest using a type alias. |
it's very hard to claim a Client varibal now. |
What does "claim" mean in this context? Regarding type aliases, is there some complexity I'm missing here? Something like this (applying it to @pickfire's snippet above) seems straightforward to use within application code: pub type Oauth2ClientWithEndpoints = BasicClient<EndpointSet, _, _, EndpointSet, EndpointSet>;
struct AppState {
client: Oauth2ClientWithEndpoints,
...
} Note that This is just one additional line of code for the benefit of having the correct set of client endpoints enforced at compile time and avoiding configuration errors at runtime, which has caused issues for other users in the past. |
Worth nothing that there's an existing example in the axum repo. (Yes, it improperly handles csrf, but that's explicitly called out and there's a PR to fix that.) |
I've been working on an example with Axum, & would be happy to clean it up & link here along with the Actix contributed example.
I'm not a security engineer, so it would need to be reviewed with some skepticism.
The text was updated successfully, but these errors were encountered: