class

MedusaAuthTagger

Inherits FrameworkTagger < FileHelper < Tagger < Reference < Object

Constants

AUTH_CALL_RE = /(?<![\w$.])authenticate\s*\(/
DEFINE_RE = /defineMiddlewares\s*\(/

defineMiddlewares({ routes: [{ matcher, middlewares }] }). A route whose middlewares include authenticate(...) guards the endpoints the matcher covers. A matcher that does not call authenticate does not.

MATCHER_RE = /(?:^|[{,\s])matcher\s*:\s*("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/
METHODS_RE = /(?:^|[{,\s])methods?\s*:\s*(\[[^\]]*\]|"[A-Z]+"|'[A-Z]+')/
MIDDLEWARES_RE = /(?:^|[{,\s])middlewares\s*:\s*\[/
ROUTES_RE = /(?:^|[{,\s])routes\s*:\s*\[/
VERB_RE = /\b(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/

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. Taggers declare only check_endpoint; those that need a pass over the whole set first (a project pre-scan, mcp's legacy prefixes) override perform and call super or loop themselves.

Source