-
Notifications
You must be signed in to change notification settings - Fork 2
Add.security.auth #7
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive security authentication support to the OpenAPI specification library. The changes enable the swagger_ui to properly add authorization headers to "try it out" requests by implementing the OpenAPI 3.0 security specification.
- Adds security scheme definitions and global security requirements to the OpenAPI struct
- Implements helper methods for common authentication types (API key, Bearer token, Basic auth, OAuth2, OpenID Connect)
- Provides functionality to manage security requirements at the global level
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| security.go | New file containing security-related methods and functionality for managing authentication schemes |
| openapi.go | Updated OpenAPI struct to include Security field and added SecurityScheme, Flows, and Flow type definitions |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
jbsmith7741
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you
- Update the docs/chart.drawio.svg graph to show the new security components.
- Add unit tests around the changes to verify those sections are generated as expected.
- Update the readme and/or add examples on how to use these new methods.
- This should include how someone bypasses auth for certain endpoints. Say those that don't need authentication.
Added Security objects to the openapi spec.
This allows for the swagger_ui to properly add authorization headers to "try it out" requests.