-
Notifications
You must be signed in to change notification settings - Fork 270
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
Oauth2 provider: TokenMatchesOASRequirements doesn't pass validation #469
Comments
turns out this case was simply not handled correctly. implemented a flattened list for the scopes, which now do pass validation. however, OpenAPI has not concept of alternate groups. thus i just tried to achieve the closest possible thing by flattening the list of scope groups. |
closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up. |
Why do you close this issue? I thought you will include this commit in your next version |
|
Ah sorry, I missed that.
…On Wed, 25 Aug 2021 at 16:25, T. Franzel ***@***.***> wrote:
0.18.0 was just released with this fix. is there anything missing?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#469 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOLFMG23WNKIYJX3WP6MRTT6T4MLANCNFSM5BB672HA>
.
|
It looks like you can't simply flatten the list of scopes, it breaks the OR logic - see An example from there:
E.g., for DELETE, it is supposed to accept either a scope
When you flatten the list, it becomes
I.e. all the scopes are required at the same time. |
ah I see. Somehow I didn't realize we could do multiple entries, but it is a list after all. I will have a look at it shortly. |
@pbav you were absolutely right. Somehow I overlooked the AND/OR distinction. Just needed to slightly extend the This should now do the right thing finally. |
Describe the bug
I have a ModelViewSet with permission_classes = [TokenMatchesOASRequirements], generating the schema with --validate
Using django-oauth-toolkit.
To Reproduce
Create a ModelViewset with permission_classes=[TokenMatchesOASRequirements], generate schema with --validate
Expected behavior
Schema file generated without validation errors.
The text was updated successfully, but these errors were encountered: