class

GoAuthTagger

Inherits GoRouteGroupScope < PrefixScope < FrameworkTagger < FileHelper < Tagger < Reference < Object

Constants

INLINE_AUTH_MIDDLEWARE = [/\b[Aa]uth(?:enticate|orize|Required|Middleware|Handler|Guard|Check)\b/, /\b[Rr]equire[Aa]uth\b/, /\b[Ii]s[Aa]uth(?:enticated)?\b/, /\b[Ll]ogin[Rr]equired\b/, /\b[Vv]erify[Tt]oken\b/, /\b[Cc]heck[Tt]oken\b/, /\b[Jj][Ww][Tt](?:Auth|Middleware|Verify|Check|Guard)?\b/, /\b[Aa]dmin[Oo]nly\b/, /\b[Rr]ole[Cc]heck\b/, /\b[Pp]ermission[Cc]heck\b/, /\bHertzAuth\b/, /\bIrisAuth\b/, /\bGF[Aa]uth\b/]

Auth middleware in route definition (inline middleware)

JWT_PATTERNS = [/echojwt\.\w+/, /jwtauth\.\w+/, /jwt\.New\s*\(/, /jwt\.Auth\s*\(/, /middleware\.JWT\s*\(/, /middleware\.JWTWithConfig\s*\(/]

JWT library patterns

USE_AUTH_MIDDLEWARE_PATTERNS = [/\.Use\s*\(\s*(\w*[Aa]uth\w*)/, /\.Use\s*\(\s*(\w*JWT\w*)/i, /\.Use\s*\(\s*(\w*[Tt]oken\w*)/, /\.Use\s*\(\s*(\w*[Ss]ession\w*)/, /\.Use\s*\(\s*(\w*[Pp]ermission\w*)/, /\.Use\s*\(\s*(\w*[Ll]ogin\w*)/, /\.Use\s*\(\s*(\w*RBAC\w*)/i, /\.Use\s*\(\s*(\w*ACL\w*)/i]

Middleware usage patterns in route groups

Constructors

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

Class methods

target_techs
Source

Instance methods

perform(endpoints : Array(Endpoint)) : Array(Endpoint)

The per-endpoint shape: look at each endpoint, tag in place, hand the array back. Fifteen framework taggers carried a byte-identical copy of this; they now declare only check_endpoint.

Not every framework tagger fits it — eleven still override perform because they need a pre-scan over the project (config files, middleware registration) before the per-endpoint pass, or they group endpoints first. Those keep their own.

Source