[ ] Regression
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
We are trying to migrate our old express & swagger application to Nest.
The app have security parameter for own rule that is not bearer and oauth2.
But there are only @ApiBearerAuth() @ApiOAuth2Auth().
I guess we can use a generality security decorator. Example:
@ApiSecurity(securityDefinitionName)
@Get()
async findAll() {
Nest version: 5.3.7
@nestjs/swagger: 2.5.1
Could you share your definition example?
Sure. These are almost same definition.
https://github.com/ktanakaj/breakout-mk/blob/9e5df20b302cb4a9649ae5f2f261ec25e92e060b/breakout-svr/config/default.yaml#L304
https://github.com/ktanakaj/breakout-mk/blob/9e5df20b302cb4a9649ae5f2f261ec25e92e060b/breakout-svr/src/routes/users.ts#L71
I think it is very simple definition. But I couldn't find how to decorate by @nestjs/swagger...
@kamilmysliwiec looks like it is just a BearerAuth with a custom name. Once this is solved (https://github.com/nestjs/swagger/issues/130) then you can decorate your SessionID Auth with NestJS @ktanakaj
I haven't had time to look into the #130 solution but will do this weekend.
Oh, great! I'll try to use BearerAuth with a custom name after #130 is solved. Thanks a lot!
@ktanakaj PR has been opened. Hopefully it gets reviewed and merged soon
Added in the next version (to install run npm i @nestjs/swagger@next). Note: remember to update @nestjs/common, @nestjs/core and typescript as well to ensure that you're using the latest versions.
Steps to migrate: https://github.com/nestjs/swagger/pull/355#issuecomment-547925879
I was able to add my security definition by new @ApiSecurity tag on @nestjs/swagger@next. Thank you so much :+1:
4.0.0 has been published
Are there some release notes somewhere we can read? My project is on 3.1.x so I don't have access to @ApiSecurity - but it would be nice to have release notes so I can get a general flavor of how compatible 4.x is with 3.x.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
4.0.0 has been published