Class: ReactorSDK::Configuration
- Inherits:
-
Object
- Object
- ReactorSDK::Configuration
- Defined in:
- lib/reactor_sdk/configuration.rb
Constant Summary collapse
- DEFAULT_BASE_URL =
Default Reactor API base URL
'https://reactor.adobe.io'- DEFAULT_TIMEOUT =
Default HTTP timeout in seconds
30
Instance Attribute Summary collapse
-
#auto_refresh_token ⇒ Boolean
readonly
Whether to auto-refresh the token before expiry.
-
#base_url ⇒ String
readonly
Reactor API base URL.
-
#client_id ⇒ String
readonly
Adobe Developer Console client ID.
-
#client_secret ⇒ String
readonly
Adobe Developer Console client secret.
-
#ims_token_url ⇒ String
readonly
Adobe IMS token endpoint URL — overridable for testing.
-
#logger ⇒ Logger?
readonly
Optional logger — if provided, HTTP calls are logged.
-
#org_id ⇒ String
readonly
Adobe IMS organisation ID (format: XXXXX@AdobeOrg).
-
#timeout ⇒ Integer
readonly
HTTP timeout in seconds.
Instance Method Summary collapse
-
#initialize(client_id:, client_secret:, org_id:, base_url: DEFAULT_BASE_URL, ims_token_url: Authentication::IMS_TOKEN_URL, timeout: DEFAULT_TIMEOUT, logger: nil, auto_refresh_token: true) ⇒ Configuration
constructor
Initializes and validates SDK configuration.
Constructor Details
#initialize(client_id:, client_secret:, org_id:, base_url: DEFAULT_BASE_URL, ims_token_url: Authentication::IMS_TOKEN_URL, timeout: DEFAULT_TIMEOUT, logger: nil, auto_refresh_token: true) ⇒ Configuration
Initializes and validates SDK configuration.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/reactor_sdk/configuration.rb', line 65 def initialize( client_id:, client_secret:, org_id:, base_url: DEFAULT_BASE_URL, ims_token_url: Authentication::IMS_TOKEN_URL, timeout: DEFAULT_TIMEOUT, logger: nil, auto_refresh_token: true ) @client_id = client_id @client_secret = client_secret @org_id = org_id @base_url = base_url @ims_token_url = ims_token_url @timeout = timeout @logger = logger @auto_refresh_token = auto_refresh_token validate! end |
Instance Attribute Details
#auto_refresh_token ⇒ Boolean (readonly)
Returns Whether to auto-refresh the token before expiry.
48 49 50 |
# File 'lib/reactor_sdk/configuration.rb', line 48 def auto_refresh_token @auto_refresh_token end |
#base_url ⇒ String (readonly)
Returns Reactor API base URL.
36 37 38 |
# File 'lib/reactor_sdk/configuration.rb', line 36 def base_url @base_url end |
#client_id ⇒ String (readonly)
Returns Adobe Developer Console client ID.
27 28 29 |
# File 'lib/reactor_sdk/configuration.rb', line 27 def client_id @client_id end |
#client_secret ⇒ String (readonly)
Returns Adobe Developer Console client secret.
30 31 32 |
# File 'lib/reactor_sdk/configuration.rb', line 30 def client_secret @client_secret end |
#ims_token_url ⇒ String (readonly)
Returns Adobe IMS token endpoint URL — overridable for testing.
39 40 41 |
# File 'lib/reactor_sdk/configuration.rb', line 39 def ims_token_url @ims_token_url end |
#logger ⇒ Logger? (readonly)
Returns Optional logger — if provided, HTTP calls are logged.
45 46 47 |
# File 'lib/reactor_sdk/configuration.rb', line 45 def logger @logger end |
#org_id ⇒ String (readonly)
Returns Adobe IMS organisation ID (format: XXXXX@AdobeOrg).
33 34 35 |
# File 'lib/reactor_sdk/configuration.rb', line 33 def org_id @org_id end |
#timeout ⇒ Integer (readonly)
Returns HTTP timeout in seconds.
42 43 44 |
# File 'lib/reactor_sdk/configuration.rb', line 42 def timeout @timeout end |