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

feat: add support for multiple authentication types #1230

Merged
merged 1 commit into from
Mar 19, 2021
Merged

feat: add support for multiple authentication types #1230

merged 1 commit into from
Mar 19, 2021

Conversation

nean
Copy link
Contributor

@nean nean commented Feb 24, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

The current api only allows for combining security requirements using logical OR. OpenApi specification also supports combining security requirements using logical AND.
https://swagger.io/docs/specification/authentication/

@ApiSecurity('key1')
@ApiSecurity('key2')
@Controller('cats')
class CatsController {}
{
  "security": [
    { "key1": [] },
    { "key2": [] }
  ]
}

Issue Number: #130

What is the new behavior?

@ApiSecurity({ key1: [], key2: []})
@Controller('cats')
class CatsController {}
{
  "security": [
    { "key1": [] , "key2": [] }
  ]
}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@kamilmysliwiec kamilmysliwiec merged commit 1129aae into nestjs:master Mar 19, 2021
@kamilmysliwiec
Copy link
Member

LGTM

@nean nean deleted the feat/multiple-authentication-types branch March 23, 2021 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants