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

Feature: Add security schemes, headers, cookies, form and files in OpenAPI schema #3635

Closed
leandrodamascena opened this issue Jan 15, 2024 Discussed in #3609 · 2 comments
Closed
Labels

Comments

@leandrodamascena
Copy link
Contributor

Discussed in #3609

Originally posted by gregggilbert-ivadolabs January 10, 2024
Adding API Key authorization in a Swagger template is pretty straightforward. One simple need to add to the template:

components:
  securitySchemes:
    ApiKeyAuth:        # arbitrary name for the security scheme
      type: apiKey
      in: header       # can be "header", "query" or "cookie"
      name: X-API-KEY  # name of the header, query parameter or cookie
# 2) Apply the API key globally to all operations
security:
  - ApiKeyAuth: []     # use the same name as under securitySchemes

How can this be achieved with PowerTools' automatic Swagger documentation generation?
app.enable_swagger() doesn't offer any way to add content to the Swagger template.

@leandrodamascena leandrodamascena changed the title Feature: Add security schemes, headers, cookies and files in OpenAPI schema Feature: Add security schemes, headers, cookies, form and files in OpenAPI schema Jan 22, 2024
@leandrodamascena
Copy link
Contributor Author

Closing this issue in favor of #3661, #3662 and #3663/

Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant