Class: AtlasRb::Configuration
- Inherits:
-
Object
- Object
- AtlasRb::Configuration
- Defined in:
- lib/atlas_rb/configuration.rb
Overview
Holds gem-wide configuration registered via configure.
The configuration model is deliberately tiny: two slots, both of which accept callables. The gem stays consumer-agnostic — it knows nothing about Rails, Devise, or any host application's request lifecycle — and instead lets the consumer hand it lambdas that resolve the per-request ambient context when a request is about to go out.
Slots
#default_nuid — callable that returns the acting user's NUID when a resource method is called without an explicit
nuid:kwarg. Typically a lambda reading fromActiveSupport::CurrentAttributesin a Rails host (-> { Current.nuid }). Set tonil(the default) to disable the fall-through — callers must then passnuid:explicitly.#default_on_behalf_of — callable that returns the NUID an Atlas request is being made on behalf of, sent as the
On-Behalf-Of:header. Used by the acting-as / view-as feature on the consumer side.nil(the default) sends no header.
Carve-outs
System-path calls under System route through
FaradayHelper#system_connection, which never consults either slot —
the SSO provisioning endpoint authenticates as the system fixture, not
as the ambient user. Admin-path calls under Admin still
consult the slots (the operator is a real user) but require an
explicit confirm: kwarg as the friction marker for destructive intent.
Instance Attribute Summary collapse
-
#default_nuid ⇒ Proc?
Callable returning the acting user's NUID, or nil to disable the fall-through.
-
#default_on_behalf_of ⇒ Proc?
Callable returning the on-behalf-of NUID, or nil to send no
On-Behalf-Of:header.
Instance Attribute Details
#default_nuid ⇒ Proc?
Returns callable returning the acting user's NUID, or nil to disable the fall-through.
42 43 44 |
# File 'lib/atlas_rb/configuration.rb', line 42 def default_nuid @default_nuid end |
#default_on_behalf_of ⇒ Proc?
Returns callable returning the on-behalf-of NUID, or nil
to send no On-Behalf-Of: header.
46 47 48 |
# File 'lib/atlas_rb/configuration.rb', line 46 def default_on_behalf_of @default_on_behalf_of end |