Module: Fluence::Gateway::Configuration
- Included in:
- Fluence::Gateway
- Defined in:
- lib/fluence/gateway/configuration.rb
Overview
Provides SDK configuration management.
Extended by Fluence::Gateway so that #config and #configure are available directly on the module (no instance to pass around). The underlying storage is a Settings singleton.
Every attribute (except timeout and tenants) resolves in three
tiers: explicit setter value, then a matching ENV variable, then a
hard-coded default. client_id and client_secret have no
hard-coded default — they must be provided either via the setter or
via APPCENTER_CLIENT_ID/APPCENTER_CLIENT_SECRET before any
gateway call.
Defined Under Namespace
Classes: Settings, TenantConfig
Constant Summary collapse
- PROFILES =
Profiles of default settings. Selecting a profile via Settings#profile= (or
ENV['GATEWAY_PROFILE']) swaps the defaults forgateway_url,appcenter_url,ssl_verify, and the built-in tenants. Explicit setter values and matching ENV variables still win over profile defaults — the profile only affects the fallback layer.Available profiles:
:production(default) — the Fluence cloud infrastructure. URLs resolve to*.fluence.eu, SSL peer verification is:peer, and the:mosaicbuilt-in tenant points atmosaic.fluence.eu.:local— the Fluence local Caddy setup exposing*.fluence-europe.dev. URLs resolve to*.fluence-europe.dev, SSL peer verification is:none(Caddy's self-signed chain is not always in Ruby's trust store), and the:mosaicbuilt-in tenant points atmosaic.fluence-europe.dev.
Each profile entry carries the default global URLs and a nested
:tenantsHash with the per-profile built-in tenant overrides. { production: { gateway_url: 'https://gateway.fluence.eu', appcenter_url: 'https://appcenter.fluence.eu', ssl_verify: :peer, tenants: { mosaic: { gateway_url: 'https://mosaic.fluence.eu', ssr_tenant: true }.freeze }.freeze }.freeze, local: { gateway_url: 'https://gateway.fluence-europe.dev', appcenter_url: 'https://appcenter.fluence-europe.dev', ssl_verify: :none, tenants: { mosaic: { gateway_url: 'https://mosaic.fluence-europe.dev', ssr_tenant: true }.freeze }.freeze }.freeze }.freeze
Instance Method Summary collapse
-
#config ⇒ Settings
Returns the singleton configuration instance.
-
#configure {|config| ... } ⇒ void
Configures the SDK via a block.
Instance Method Details
#config ⇒ Settings
Returns the singleton configuration instance.
#configure {|config| ... } ⇒ void
This method returns an undefined value.
Configures the SDK via a block.