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

Display scope for non OAuth security schemes #451

Closed
guitaoliu opened this issue Feb 22, 2023 · 2 comments
Closed

Display scope for non OAuth security schemes #451

guitaoliu opened this issue Feb 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@guitaoliu
Copy link
Contributor

Describe the bug

OpenAPI 3.1.0 allows scopes to be defined for security schemes other than OAuth:

In a case where we define the API spec for endpoints protected by a customized JWT access token, we would expect the access token to define the scopes that the user can access. Although OpenAPI 3.1 is not officially supported by this project, it should be possible to adopt this feature.

Expected behavior

Both of the following securitySchemes should render the scopes under Authorization.

security:
  - petstore_auth:
      - "write:pets"
      - "read:pets"
  - api_key: 
      - "write:pets"
      - "read:pets"

securitySchemes:
    petstore_auth:
      description: |
        Get access to data while protecting your account credentials.
        OAuth2 is also a safer and more secure way to give you access.
      type: oauth2
      flows:
        implicit:
          authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
          scopes:
            "write:pets": modify pets in your account
            "read:pets": read your pets
    api_key:
      description: >
        For this sample, you can use the api key `special-key` to test the
        authorization filters.
      type: apiKey
      name: api_key
      in: header
@guitaoliu guitaoliu added the bug Something isn't working label Feb 22, 2023
@welcome-to-palo-alto-networks

🎉 Thanks for opening your first issue here! Welcome to the community!

@guitaoliu
Copy link
Contributor Author

guitaoliu commented Feb 22, 2023

Should be fixed by #444. Thanks.

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

1 participant