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

Add bearer security scope support #207

Open
defunctzombie opened this issue Dec 2, 2022 · 1 comment
Open

Add bearer security scope support #207

defunctzombie opened this issue Dec 2, 2022 · 1 comment

Comments

@defunctzombie
Copy link

With openapi 3.1.0 the spec now allows for specifying scopes for bearer auth. This is useful for APIs which accept API keys in headers (with bearer auth) and the user can configure the key to have certain permissions. A good example of this is cloud providers and roles attached to the api key.

What would be the correct way to introduce this concept to the types and transformations provided in this library. The ultimate goal is to update elements to display these required scopes/roles for specific http routes. The display is similar to how oauth scopes are displayed except these are for API keys.

it('should support bearer scopes', () => {
    const document: Partial<OpenAPIObject> = {
      openapi: '3.1.0',
      components: {
        schemas: {},
        securitySchemes: {
          'API Key': {
            type: 'http',
            scheme: 'bearer',
          },
        },
      },
      security: [{ 'API Key': ['read'] }],
    };

Right now the transformed object does not include these scopes and elements is not able to display them because they don't exist in the transformed object.

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

No branches or pull requests

1 participant