Class: Fluence::Gateway::Auth::Configuration
- Inherits:
-
Object
- Object
- Fluence::Gateway::Auth::Configuration
- Defined in:
- lib/fluence/gateway/auth/configuration.rb
Overview
Process-wide configuration for fluence-gateway-auth. Access
the singleton through configuration, or
mutate it with configure. All settings
have sane defaults except hmac_secret, which must be provided
either explicitly or via the GATEWAY_HMAC_SECRET environment
variable.
Constant Summary collapse
- SCOPE_NAME_PATTERN =
Regex every configuration-derived Ruby identifier must match: lowercase letters, digits and underscores, never starting with a digit. Applied to #scope_name and #subject_column to keep generated method names safe.
/\A[a-z_][a-z0-9_]*\z/
Instance Attribute Summary collapse
-
#hmac_secret ⇒ String
Resolves the HMAC secret used to verify gateway signatures.
-
#on_missing_user ⇒ #call?
Just-in-time user provisioning hook.
-
#skip_middleware ⇒ Boolean
Bypass for HMAC verification in tests.
-
#subject_column ⇒ Symbol
Column on #user_model used to look up the current user.
-
#user_model ⇒ String
Class name of the model used to resolve the current user.
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Initialises with the gem's baseline defaults.
-
#scope_name ⇒ Symbol
Scope name used to derive the controller helper names
current_<scope>,authenticate_<scope>!and<scope>_signed_in?. -
#scope_name=(value) ⇒ Symbol
Overrides the scope name.
Constructor Details
#initialize ⇒ void
Initialises with the gem's baseline defaults. Called once per process by Fluence::Gateway::Auth.configuration.
Instance Attribute Details
#hmac_secret ⇒ String
Resolves the HMAC secret used to verify gateway signatures.
Reads from the explicit value set via #hmac_secret=, falling
back to ENV['GATEWAY_HMAC_SECRET'].
#on_missing_user ⇒ #call?
Just-in-time user provisioning hook.
#skip_middleware ⇒ Boolean
Bypass for HMAC verification in tests.
When true, Middleware#call short-circuits and forwards
requests unchecked. TestHelpers flips this to true at
load time — never enable it in production.
#subject_column ⇒ Symbol
Column on #user_model used to look up the current user.
#user_model ⇒ String
Class name of the model used to resolve the current user.
Instance Method Details
#scope_name ⇒ Symbol
Scope name used to derive the controller helper names
current_<scope>, authenticate_<scope>! and
<scope>_signed_in?.
If no explicit override was set via #scope_name=, the value
is derived once from user_model.demodulize.underscore.
#scope_name=(value) ⇒ Symbol
Overrides the scope name. Useful when the value derived from #user_model is not the helper name you want.