Class: Fluence::Gateway::Configuration::TenantConfig
- Inherits:
-
Data
- Object
- Data
- Fluence::Gateway::Configuration::TenantConfig
- Defined in:
- lib/fluence/gateway/configuration.rb
Overview
Immutable value object returned by Settings#tenant_config.
Built on top of Data.define, so it is frozen on creation,
exposes read-only accessors for every field, and implements
hash / eql? / == based on the full tuple of values. This
makes it safe to use as a cache key in Fluence::Gateway::Client without any
defensive copying at the call site.
ssl_options is deep-duped (via Object#deep_dup from
ActiveSupport) and deep-frozen (via IceNine.deep_freeze) at
construction time, so neither the top-level Hash nor any
nested Hash/Array inside it can be mutated after the
TenantConfig is created. nil and non-Hash values are
normalised to an empty frozen Hash so the invariant holds
even when a tenant override declares ssl_options: nil.
A #[] delegator is kept so code that still reads fields via
settings[:client_id] continues to work. Keys must be
Symbols — settings['client_id'] raises ArgumentError
rather than silently returning nil (as a plain Hash would)
or coercing the String to a method name. Unknown Symbol keys
raise NoMethodError, matching direct reader access.
Instance Attribute Summary collapse
-
#appcenter_url ⇒ String
readonly
The effective appcenter (OAuth2 server) base URL for this tenant.
-
#client_id ⇒ String?
readonly
The effective OAuth2 client identifier for this tenant.
-
#client_secret ⇒ String?
readonly
The effective OAuth2 client secret for this tenant.
-
#gateway_url ⇒ String
readonly
The effective gateway base URL for this tenant.
-
#scope ⇒ String
readonly
The OAuth2 scope requested on the
client_credentialsgrant. -
#ssl_ca_file ⇒ String?
readonly
Path to an extra CA file trusted on top of the system store, or
nilto use the system store only. -
#ssl_options ⇒ Hash
readonly
Frozen pass-through Faraday SSL options merged last into the
ssl:Hash built forOAuth2::Client#connection_opts. -
#ssl_verify ⇒ Symbol
readonly
The canonical SSL verify mode for this tenant (one of
:peer,:none,:client_once,:fail_if_no_peer_cert). -
#ssr_tenant ⇒ Boolean
readonly
Whether the effective tenant is a single-service (SSR) tenant.
-
#timeout ⇒ Integer
readonly
The effective HTTP timeout, in seconds, for this tenant.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Hash-style accessor kept for backward compatibility with callers that used
tenant_config(...)[:key]when the method still returned a plain Hash.
Instance Attribute Details
#appcenter_url ⇒ String (readonly)
The effective appcenter (OAuth2 server) base URL for this tenant.
#client_id ⇒ String? (readonly)
The effective OAuth2 client identifier for this tenant.
#client_secret ⇒ String? (readonly)
The effective OAuth2 client secret for this tenant.
#gateway_url ⇒ String (readonly)
The effective gateway base URL for this tenant.
#scope ⇒ String (readonly)
The OAuth2 scope requested on the client_credentials grant.
#ssl_ca_file ⇒ String? (readonly)
Path to an extra CA file trusted on top of the system store,
or nil to use the system store only. Ignored when
ssl_verify is :none.
#ssl_options ⇒ Hash (readonly)
Frozen pass-through Faraday SSL options merged last into the
ssl: Hash built for OAuth2::Client#connection_opts.
#ssl_verify ⇒ Symbol (readonly)
The canonical SSL verify mode for this tenant (one of :peer,
:none, :client_once, :fail_if_no_peer_cert).
#ssr_tenant ⇒ Boolean (readonly)
Whether the effective tenant is a single-service (SSR) tenant.
When true, API calls that pass a service: kwarg raise
ServiceNotAllowedError.
#timeout ⇒ Integer (readonly)
The effective HTTP timeout, in seconds, for this tenant.
Instance Method Details
#[](key) ⇒ Object
Hash-style accessor kept for backward compatibility with
callers that used tenant_config(...)[:key] when the method
still returned a plain Hash. Symbol-only — passing a String
raises ArgumentError rather than silently returning nil
(as a plain Hash would for missing keys).