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

How to cancel security on specific page - OAPI3 #1169

Open
pilotak opened this issue Dec 7, 2020 · 2 comments
Open

How to cancel security on specific page - OAPI3 #1169

pilotak opened this issue Dec 7, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@pilotak
Copy link

pilotak commented Dec 7, 2020

When setting up global security, all pages require to be authorized. But i don't want such a feature on login page. How can i disable it on a specific page?

@endpoint({
  method: 'POST',
  path: '/login',
})
class Login {
  @response({ status: 200 })
  successResponse(@body body: Response) {}
}

@api({ name: 'test', version: '0.0.1' })
class Api {
  @securityHeader
  'security-header': string;
}

output should be

paths:
  /login:
    post:
      operationId: Login
      security: [] # no auth needed
      responses:
        '200':
          ...
@jankuca
Copy link
Contributor

jankuca commented Dec 7, 2020

Personally, I have a post-processing script which adds "security": [] to endpoints with a specific tag.

@pilotak
Copy link
Author

pilotak commented Dec 7, 2020

I was thinking about that too, but this should be built in. As well as ability to change the type of security to ie. Bearer or set more types of security (as seen in feature request)

This is perfect plugin if you don't need security features, unfortunately

@lfportal lfportal added the enhancement New feature or request label Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants