Class: MyInfo::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/myinfo.rb

Overview

Configuration to set various properties needed to use MyInfo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_idObject

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_urlObject

Returns the value of attribute authorise_jwks_base_url.



41
42
43
# File 'lib/myinfo.rb', line 41

def authorise_jwks_base_url
  @authorise_jwks_base_url
end

#base_urlObject

Returns the value of attribute base_url.



56
57
58
# File 'lib/myinfo.rb', line 56

def base_url
  @base_url
end

#client_idObject

Returns the value of attribute client_id.



41
42
43
# File 'lib/myinfo.rb', line 41

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



41
42
43
# File 'lib/myinfo.rb', line 41

def client_secret
  @client_secret
end

#gateway_keyObject

Returns the value of attribute gateway_key.



41
42
43
# File 'lib/myinfo.rb', line 41

def gateway_key
  @gateway_key
end

#gateway_urlObject

Returns the value of attribute gateway_url.



41
42
43
# File 'lib/myinfo.rb', line 41

def gateway_url
  @gateway_url
end

#private_encryption_keyObject

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_keyObject

Returns the value of attribute private_key.



41
42
43
# File 'lib/myinfo.rb', line 41

def private_key
  @private_key
end

#private_signing_keyObject

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

#proxyObject

Returns the value of attribute proxy.



41
42
43
# File 'lib/myinfo.rb', line 41

def proxy
  @proxy
end

#public_certObject

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

Parameters:

  • value

    the value to set the attribute public_facing to.



57
58
59
# File 'lib/myinfo.rb', line 57

def public_facing=(value)
  @public_facing = value
end

#redirect_uriObject

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

Parameters:

  • value

    the value to set the attribute sandbox to.



57
58
59
# File 'lib/myinfo.rb', line 57

def sandbox=(value)
  @sandbox = value
end

#singpass_eservice_idObject

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_idObject

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_protocolObject



69
70
71
# File 'lib/myinfo.rb', line 69

def base_url_with_protocol
  "https://#{base_url}"
end

#gateway_hostObject



73
74
75
# File 'lib/myinfo.rb', line 73

def gateway_host
  gateway_url&.sub('https://', '')&.split('/')&.first
end

#gateway_pathObject



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

Returns:

  • (Boolean)


81
82
83
# File 'lib/myinfo.rb', line 81

def public?
  @public_facing
end

#sandbox?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/myinfo.rb', line 85

def sandbox?
  @sandbox
end