Module: OpConnect::Default
- Defined in:
- lib/op_connect/default.rb
Overview
Default configuration options for Client
Constant Summary collapse
- API_ENDPOINT =
"http://localhost:8080/v1"
- USER_AGENT =
"1Password Connect Ruby SDK #{OpConnect::VERSION}"
Class Method Summary collapse
-
.access_token ⇒ String
Default access token from ENV.
-
.adapter ⇒ Symbol
Default network adapter for Faraday (defaults to :net_http).
-
.api_endpoint ⇒ <Type>
Default API endpoint from ENV or API_ENDPOINT.
-
.options ⇒ Hash
Configuration options.
- .stubs ⇒ Object
-
.user_agent ⇒ <Type>
Default user agent from ENV or USER_AGENT.
Class Method Details
.access_token ⇒ String
Default access token from ENV
25 26 27 |
# File 'lib/op_connect/default.rb', line 25 def access_token ENV["OP_CONNECT_ACCESS_TOKEN"] end |
.adapter ⇒ Symbol
Default network adapter for Faraday (defaults to :net_http)
33 34 35 |
# File 'lib/op_connect/default.rb', line 33 def adapter Faraday.default_adapter end |
.api_endpoint ⇒ <Type>
Default API endpoint from ENV or API_ENDPOINT
41 42 43 |
# File 'lib/op_connect/default.rb', line 41 def api_endpoint ENV["OP_CONNECT_API_ENDPOINT"] || API_ENDPOINT end |
.options ⇒ Hash
Configuration options
17 18 19 |
# File 'lib/op_connect/default.rb', line 17 def OpConnect::Configurable.keys.map { |key| [key, send(key)] }.to_h end |
.stubs ⇒ Object
45 46 |
# File 'lib/op_connect/default.rb', line 45 def stubs end |
.user_agent ⇒ <Type>
Default user agent from ENV or USER_AGENT
52 53 54 |
# File 'lib/op_connect/default.rb', line 52 def user_agent ENV["OP_CONNECT_USER_AGENT"] || USER_AGENT end |