class

ElixirAuthTagger

Inherits FrameworkTagger < FileHelper < Tagger < Reference < Object

Constants

AUTH_PIPELINE_ATOM = /\A(?:require_|ensure_)?auth\w*\z/

A pipe_through atom that names an auth pipeline by convention: :auth, :authenticated, phx.gen.auth's :require_authenticated_user, :ensure_auth. :redirect_if_user_is_authenticated, the guest-only pipeline phx.gen.auth puts the login pages behind, is not one.

ENFORCING_PLUG = /plug\s*\(?\s*(?::require_\w+|:ensure_\w*auth\w*|:authenticate\w*|:basic_auth\b|(?:\w+\.)*(?:EnsureAuthenticated|RequireAuthenticated|RequireAuth\w*|BasicAuth)\b)/

A plug that rejects an unauthenticated request, which is what makes a pipeline an auth pipeline. Loading plugs (Guardian.Plug.VerifyHeader, LoadResource, allow_blank: true, :fetch_current_user) and the Ueberauth OAuth login flow let anonymous callers through. Only the fallback for plugs whose definition is not in the tree (library plugs); an in-tree plug is judged by Noir::ElixirPlugJudge.

LIVE_SESSION_AUTH = /:((?:ensure|require)_authenticated\w*)/

live_session ..., on_mount: [{UserAuth, :ensure_authenticated}] (1.7) / :require_authenticated (1.8), not :mount_current_user.

PLUG_STATEMENT = /\Aplug\s*\(?\s*(:\w+[!?]?|[A-Z][\w.]*)/

The plugged module or function atom, and its when clause if any.

PLUG_WHEN = /\bwhen\s+(not\s+)?\(?\s*action\s+(not\s+)?in\s+(.+)\z/m

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. 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