Skip to content

Conversation

@zJeremiah
Copy link
Contributor

Added Security objects to the openapi spec.
This allows for the swagger_ui to properly add authorization headers to "try it out" requests.

@zJeremiah zJeremiah requested a review from Copilot July 16, 2025 18:32
Copy link
Contributor

Copilot AI left a 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

zJeremiah and others added 3 commits July 16, 2025 12:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@jbsmith7741 jbsmith7741 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you

  1. Update the docs/chart.drawio.svg graph to show the new security components.
  2. Add unit tests around the changes to verify those sections are generated as expected.
  3. Update the readme and/or add examples on how to use these new methods.
    1. This should include how someone bypasses auth for certain endpoints. Say those that don't need authentication.

@zJeremiah zJeremiah merged commit bf89e19 into hydronica:main Jul 29, 2025
2 checks passed
@zJeremiah zJeremiah deleted the add.security.auth branch July 29, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants