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

Proposal to describe OAuth2 flows #3490

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

leoniv
Copy link
Contributor

@leoniv leoniv commented Jan 29, 2024

Hello everyone!

Here is proposal how to describe OAuth2 a bit more precisely. I encountered in inability to describe the client credentials flow and then I looked through the code and made up with such solution. It's not pretty well, but it should work.

@adamw
Copy link
Member

adamw commented Jan 30, 2024

Thank - these changes look good! MiMA seems to pass without problems?

One idea that might improve the discrimination of flows is using an attribute on the input returned by authorizationCodeFlow etc. - we could define a dedicated datatype which would hold the scope types, define an AttributeKey, set it in the *flow methods, and read in the docs interpreter.

We use attributes in a similar way e.g. to support the title property:

val Attribute: AttributeKey[Title] = new AttributeKey[Title]("sttp.tapir.Schema.Title")

Wdyt?

@leoniv
Copy link
Contributor Author

leoniv commented Jan 31, 2024

One idea that might improve the discrimination of flows is using an attribute on the input returned by authorizationCodeFlow etc. - we could define a dedicated datatype which would hold the scope types, define an AttributeKey, set it in the *flow methods, and read in the docs interpreter.

This idea is much better, take a look pleas.

@adamw adamw merged commit d71bb4c into softwaremill:master Feb 2, 2024
23 checks passed
@adamw
Copy link
Member

adamw commented Feb 2, 2024

Thanks! :)

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.

2 participants