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

OpenAPI 3 oauth2 security scheme not applied globally for all endpoints #240

Open
toedter opened this issue May 23, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@toedter
Copy link

toedter commented May 23, 2023

When providing an OpenAPI 3 security scheme, like

openapi3 {
    server = 'https://myserver.com/api'
    title = 'My API'
    description = 'My api description'
    version = '0.5.0'
    format = 'yaml'
    oauth2SecuritySchemeDefinition = {
        flows = ['authorizationCode']
        tokenUrl = 'https://myauthserver.com/oauth/token'
        authorizationUrl = 'https://myauthserver.com/authorize'
    }
}

the securitySchemes is created correctly in the openapi3.yaml.

But to apply it to all endpoints, an additional (top-level) entry like

security:
  - oauth2: []

would be needed.

I did not find a way to create this entry.

@ozscheyge ozscheyge added the bug Something isn't working label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants