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] Shared Components in the @auth tag #122

Open
rsamoilov opened this issue Jan 9, 2025 · 0 comments
Open

[OpenAPI] Shared Components in the @auth tag #122

rsamoilov opened this issue Jan 9, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@rsamoilov
Copy link
Member

Description

Currently, Rage supports specifying security schemes for an application using the @auth tag.

The tag supports two forms:

  • using the default scheme:
# @auth authenticate_user
  • using a custom scheme inlined into the tag:
# @auth authenticate_by_token
#   type: apiKey
#   in: header
#   name: X-API-Key

Unless it is something really simple and straightforward, we recommend avoiding inlining YAML into tags. Thus, it makes sense to update the @auth tag to accept a shared reference. For example:

# @auth authenticate_by_token #/components/securitySchemes/ApiKeyAuth

Such tag would apply the ApiKeyAuth security scheme to all necessary controller actions.

Tips

@rsamoilov rsamoilov added the good first issue Good for newcomers label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant