Class: MyInfo::Configuration
- Inherits:
-
Object
- Object
- MyInfo::Configuration
- Defined in:
- lib/myinfo.rb
Overview
Configuration to set various properties needed to use MyInfo
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#authorise_jwks_base_url ⇒ Object
Returns the value of attribute authorise_jwks_base_url.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
-
#gateway_key ⇒ Object
Returns the value of attribute gateway_key.
-
#gateway_url ⇒ Object
Returns the value of attribute gateway_url.
-
#private_encryption_key ⇒ Object
Returns the value of attribute private_encryption_key.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#private_signing_key ⇒ Object
Returns the value of attribute private_signing_key.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#public_cert ⇒ Object
Returns the value of attribute public_cert.
-
#public_facing ⇒ Object
writeonly
Sets the attribute public_facing.
-
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
-
#sandbox ⇒ Object
writeonly
Sets the attribute sandbox.
-
#singpass_eservice_id ⇒ Object
Returns the value of attribute singpass_eservice_id.
-
#subentity_id ⇒ Object
Returns the value of attribute subentity_id.
Instance Method Summary collapse
- #base_url_with_protocol ⇒ Object
- #gateway_host ⇒ Object
- #gateway_path ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #public? ⇒ Boolean
- #sandbox? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
59 60 61 62 63 |
# File 'lib/myinfo.rb', line 59 def initialize @public_facing = false @sandbox = false @proxy = { address: nil, port: nil } end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def app_id @app_id end |
#authorise_jwks_base_url ⇒ Object
Returns the value of attribute authorise_jwks_base_url.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def end |
#base_url ⇒ Object
Returns the value of attribute base_url.
56 57 58 |
# File 'lib/myinfo.rb', line 56 def base_url @base_url end |
#client_id ⇒ Object
Returns the value of attribute client_id.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def client_secret @client_secret end |
#gateway_key ⇒ Object
Returns the value of attribute gateway_key.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def gateway_key @gateway_key end |
#gateway_url ⇒ Object
Returns the value of attribute gateway_url.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def gateway_url @gateway_url end |
#private_encryption_key ⇒ Object
Returns the value of attribute private_encryption_key.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def private_encryption_key @private_encryption_key end |
#private_key ⇒ Object
Returns the value of attribute private_key.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def private_key @private_key end |
#private_signing_key ⇒ Object
Returns the value of attribute private_signing_key.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def private_signing_key @private_signing_key end |
#proxy ⇒ Object
Returns the value of attribute proxy.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def proxy @proxy end |
#public_cert ⇒ Object
Returns the value of attribute public_cert.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def public_cert @public_cert end |
#public_facing=(value) ⇒ Object (writeonly)
Sets the attribute public_facing
57 58 59 |
# File 'lib/myinfo.rb', line 57 def public_facing=(value) @public_facing = value end |
#redirect_uri ⇒ Object
Returns the value of attribute redirect_uri.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def redirect_uri @redirect_uri end |
#sandbox=(value) ⇒ Object (writeonly)
Sets the attribute sandbox
57 58 59 |
# File 'lib/myinfo.rb', line 57 def sandbox=(value) @sandbox = value end |
#singpass_eservice_id ⇒ Object
Returns the value of attribute singpass_eservice_id.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def singpass_eservice_id @singpass_eservice_id end |
#subentity_id ⇒ Object
Returns the value of attribute subentity_id.
41 42 43 |
# File 'lib/myinfo.rb', line 41 def subentity_id @subentity_id end |
Instance Method Details
#base_url_with_protocol ⇒ Object
69 70 71 |
# File 'lib/myinfo.rb', line 69 def base_url_with_protocol "https://#{base_url}" end |
#gateway_host ⇒ Object
73 74 75 |
# File 'lib/myinfo.rb', line 73 def gateway_host gateway_url&.sub('https://', '')&.split('/')&.first end |
#gateway_path ⇒ Object
77 78 79 |
# File 'lib/myinfo.rb', line 77 def gateway_path gateway_url.present? ? gateway_url.sub('https://', '').split('/')[1..].join('/') : '' end |
#public? ⇒ Boolean
81 82 83 |
# File 'lib/myinfo.rb', line 81 def public? @public_facing end |
#sandbox? ⇒ Boolean
85 86 87 |
# File 'lib/myinfo.rb', line 85 def sandbox? @sandbox end |