Project Improvement
Hey! I've been going through implementing my own (async) implementation with this, and I've been collecting thoughts that I think are actionable to better the crate.
Notably, I'm very thankful for the primitives: once you understand what most pieces do it makes it a lot easier to implement things correctly. I've certainly
However, there's a bunch of things that I felt I was lost on, and had to read source code (and play around with what was being provided) to various traits:
By far the biggest concern is the documentation on the individual traits, specifically on Registrar, Authorizer, and Issuer. The documentation on all these traits currently do not inform a trait implementation whether or not an input can be trusted or not. For example:
This probably expands to all traits, but I think these are the most important ones when it comes to getting up and running in a secure manner.
There's also a couple clarifying questions I can't seem to figure out either that I think documentation could be extremely helpful on:
Finally, I think it would be really, really helpful embedding some of the expectations of the Flow structs. It took me quite a bit of time to figure out that you need to use HTTP Basic authorization to exchange an authorization code into bearer tokens. Suggestions on how long those bearer tokens should last would also be appreciated
Other context
I'm very appreciative of the work done already. It's definitely helped clear things up with OAuth on the server implementation side.
Tracking pull request
Project Improvement
Hey! I've been going through implementing my own (async) implementation with this, and I've been collecting thoughts that I think are actionable to better the crate.
Notably, I'm very thankful for the primitives: once you understand what most pieces do it makes it a lot easier to implement things correctly. I've certainly
However, there's a bunch of things that I felt I was lost on, and had to read source code (and play around with what was being provided) to various traits:
By far the biggest concern is the documentation on the individual traits, specifically on
Registrar,Authorizer, andIssuer. The documentation on all these traits currently do not inform a trait implementation whether or not an input can be trusted or not. For example:Registrar::negotiate, is theOption<Scope>raw user input? Can we directly trustBoundClientto have a server validated redirect uri, or must we validate it before generating aPreGrant?Issuer::issue, can we trust theGrantprovided to us? Where is theGrant.untilvalue being populated from?Issuer::refresh, can we trust theGrantprovided to us?This probably expands to all traits, but I think these are the most important ones when it comes to getting up and running in a secure manner.
There's also a couple clarifying questions I can't seem to figure out either that I think documentation could be extremely helpful on:
Issuer::recover_refreshfor an Issuer that supports refresh tokens, are we to return aGrantwith anuntilvalue of the refresh token expiration or the session token expiration?redirect_uriandextensionsfields without any issues, though I suspect that's only because I currently am only doing the authorization grant flow.Finally, I think it would be really, really helpful embedding some of the expectations of the Flow structs. It took me quite a bit of time to figure out that you need to use
HTTP Basicauthorization to exchange an authorization code into bearer tokens. Suggestions on how long those bearer tokens should last would also be appreciatedOther context
I'm very appreciative of the work done already. It's definitely helped clear things up with OAuth on the server implementation side.
Tracking pull request