class NestjsAuthTagger

Defined in:

tagger/framework_taggers/javascript/nestjs_auth.cr

Constant Summary

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

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

Class Method Summary

Instance Method Summary

Instance methods inherited from class FrameworkTagger

read_file(path : String) : String | Nil read_file, read_source_context(endpoint : Endpoint) : Array(SourceContext) read_source_context

Constructor methods inherited from class FrameworkTagger

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

Class methods inherited from class FrameworkTagger

target_techs : Array(String) target_techs

Instance methods inherited from module FileHelper

all_files : Array(String) all_files, get_files_by_extension(extension : String) : Array(String) get_files_by_extension, get_files_by_prefix(prefix : String) : Array(String) get_files_by_prefix, get_files_by_prefix_and_extension(prefix : String, extension : String) : Array(String) get_files_by_prefix_and_extension, get_public_dir_files(base_path : String, folder : String) : Array(String) get_public_dir_files, get_public_files(base_path : String) : Array(String) get_public_files, populate_channel_with_files(channel : Channel(String)) populate_channel_with_files, populate_channel_with_filtered_files(channel : Channel(String), extension : String)
populate_channel_with_filtered_files(channel : Channel(String), extensions : Array(String))
populate_channel_with_filtered_files

Instance methods inherited from class Tagger

name : String name, perform(endpoints : Array(Endpoint)) : Array(Endpoint) perform

Constructor methods inherited from class Tagger

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

Constructor Detail

def self.new(options : Hash(String, YAML::Any)) #

[View source]

Class Method Detail

def self.target_techs : Array(String) #

[View source]

Instance Method Detail

def perform(endpoints : Array(Endpoint)) : Array(Endpoint) #

[View source]