class

NestjsAuthTagger

Inherits FrameworkTagger < FileHelper < Tagger < Reference < Object

Constants

AUTH_DECORATORS = [{/\@ApiBearerAuth\s*\(/, "NestJS @ApiBearerAuth (Swagger)"}, {/\@ApiBasicAuth\s*\(/, "NestJS @ApiBasicAuth (Swagger)"}, {/\@ApiOAuth2\s*\(/, "NestJS @ApiOAuth2 (Swagger)"}, {/\@ApiSecurity\s*\(/, "NestJS @ApiSecurity (Swagger)"}]

NestJS auth-related decorators

GUARD_PATTERNS = [{/\@UseGuards\s*\(\s*AuthGuard/, "NestJS @UseGuards(AuthGuard)"}, {/\@UseGuards\s*\(\s*JwtAuthGuard/, "NestJS @UseGuards(JwtAuthGuard)"}, {/\@UseGuards\s*\(\s*LocalAuthGuard/, "NestJS @UseGuards(LocalAuthGuard)"}, {/\@UseGuards\s*\(\s*RolesGuard/, "NestJS @UseGuards(RolesGuard)"}, {/\@UseGuards\s*\(\s*AuthenticationGuard/, "NestJS @UseGuards(AuthenticationGuard)"}, {/\@UseGuards\s*\(\s*\w*[Aa]uth\w*Guard/, "NestJS auth guard"}, {/\@UseGuards\s*\(\s*GqlAuthGuard/, "NestJS GraphQL auth guard"}]

NestJS guard decorators

METHOD_DECORATOR_PATTERNS = (GUARD_PATTERNS + ROLE_PATTERNS) + AUTH_DECORATORS

Every decorator a method-level walk looks for. Built once — concatenating the three lists inside the per-line loop allocated a fresh array for every line of every handler's decorator block.

PUBLIC_PATTERNS = [/\@Public\s*\(\)/, /\@SkipAuth\s*\(\)/, /\@AllowAnonymous\s*\(\)/, /\@SetMetadata\s*\(\s*['"]isPublic['"]/]

Public/skip auth markers (negative signal)

ROLE_PATTERNS = [{/\@Roles\s*\(/, "NestJS @Roles decorator"}, {/\@Permissions\s*\(/, "NestJS @Permissions decorator"}, {/\@RequirePermissions\s*\(/, "NestJS @RequirePermissions decorator"}, {/\@SetMetadata\s*\(\s*['"]roles['"]/, "NestJS role metadata"}]

NestJS role/permission decorators

Constructors

new(options : Hash(String, YAML::Any))
Source

Class methods

target_techs
Source