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

Inadequate Support for Security Schemes in TypeSpec #5392

Open
3 tasks done
mario-guerra opened this issue Dec 17, 2024 · 0 comments
Open
3 tasks done

Inadequate Support for Security Schemes in TypeSpec #5392

mario-guerra opened this issue Dec 17, 2024 · 0 comments

Comments

@mario-guerra
Copy link
Member

Clear and concise description of the problem

Issue described by Chris Wood at Ozone API in this talk.

Description:

The "add auth" decorator in TypeSpec does not provide sufficient context for implementing standard OAuth flow objects. This limitation makes it challenging to generate complete and accurate Open API descriptions for security schemes. Specifically, the current implementation lacks the ability to fully describe the various OAuth flows and their associated parameters, such as authorization URLs, token URLs, and scopes.

As a result, additional manual steps are required to ensure the security objects are correctly implemented in the emitted Open API document. This often involves using overlays or other post-processing tools to add the necessary details, which can be cumbersome and error-prone.

Steps to Reproduce:

  1. Define a security scheme using the "add auth" decorator in TypeSpec.
  2. Emit the Open API document.
  3. Observe that the emitted security scheme lacks complete information for OAuth flows.

Expected Behavior:
The "add auth" decorator should allow for the full specification of OAuth flow objects, including authorization URLs, token URLs, and scopes, resulting in a complete and accurate Open API description.

Actual Behavior:
The emitted Open API document contains incomplete security scheme information, requiring additional manual steps to correct.

Additional Context:
Improving the support for security schemes in TypeSpec would greatly enhance the usability and accuracy of the emitted Open API documents, reducing the need for manual post-processing and overlays.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant