class

SpringAuthTagger

Inherits FrameworkTagger < FileHelper < Tagger < Reference < Object

Constants

ANNOTATION_PATTERNS = [/\@PreAuthorize\s*\(/, /\@Secured\s*\(/, /\@RolesAllowed\s*\(/]
ANY_REQUEST_AUTH = /\.anyRequest\s*\(\)\s*\.\s*(authenticated|hasRole|hasAnyRole|hasAuthority|hasAnyAuthority|access)\s*(?:\(|\{)/
CLASS_ANNOTATION_NAMES = ["@PreAuthorize", "@Secured", "@RolesAllowed"]

The same authorization annotations, as the bare names they are matched by when they decorate the controller class instead of a single handler.

MATCHERS_RULE = /\.(antMatchers|requestMatchers|mvcMatchers)\s*\(([^)]+)\)\s*\.\s*(permitAll|authenticated|hasRole|hasAnyRole|hasAuthority|hasAnyAuthority|access)\s*(?:\(|\{)/

Patterns for security config URL rules. access { ... } is a protected rule too; permitAll() is intentionally tracked so a more-specific public matcher can suppress a broader protected one.

SCOPE_MATCHER_CALL = /\b(?:securityMatcher|antMatcher)\s*\(/

A chain is "scoped" only when restricted by a singular securityMatcher( / antMatcher( call. The plural antMatchers(...) / requestMatchers(...) forms are authorization rules, not scope restrictions, so a substring test like includes?("antMatcher") wrongly flips a rule-based chain to scoped and drops its anyRequest() fallback. The \s*\( boundary rejects the plural.

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