Class: MHV::AccountCreation::Configuration
Instance Attribute Summary
#base_request_headers, #open_timeout, #read_timeout, #request_types, #user_agent
Instance Method Summary
collapse
#breakers_error_threshold, #breakers_exception_handler, #breakers_matcher, #breakers_service, #create_new_breakers_service, #current_module, #request_options, #service_exception
Instance Method Details
#access_key ⇒ Object
41
42
43
|
# File 'lib/mhv/account_creation/configuration.rb', line 41
def access_key
Settings.mhv.account_creation.access_key
end
|
#account_creation_path ⇒ Object
17
18
19
|
# File 'lib/mhv/account_creation/configuration.rb', line 17
def account_creation_path
'v1/usermgmt/account-service/account'
end
|
#base_path ⇒ Object
9
10
11
|
# File 'lib/mhv/account_creation/configuration.rb', line 9
def base_path
Settings.mhv.account_creation.host
end
|
#connection ⇒ Object
45
46
47
48
49
50
51
52
53
|
# File 'lib/mhv/account_creation/configuration.rb', line 45
def connection
Faraday.new(base_path, headers: , request: request_options) do |conn|
conn.use :breakers
conn.use Faraday::Response::RaiseError
conn.adapter Faraday.default_adapter
conn.response :json
conn.response :betamocks if Settings.mhv.account_creation.mock
end
end
|
#logging_prefix ⇒ Object
21
22
23
|
# File 'lib/mhv/account_creation/configuration.rb', line 21
def logging_prefix
'[MHV][AccountCreation][Service]'
end
|
#mhv_sts_settings ⇒ Object
82
83
84
|
# File 'lib/mhv/account_creation/configuration.rb', line 82
def mhv_sts_settings
Settings.mhv.account_creation.sts
end
|
#service_name ⇒ Object
13
14
15
|
# File 'lib/mhv/account_creation/configuration.rb', line 13
def service_name
'mhv_account_creation'
end
|
#sts_client(user_identifier) ⇒ Object
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/mhv/account_creation/configuration.rb', line 67
def sts_client(user_identifier)
SignInService::Sts.new(
service_account_id: mhv_sts_settings.service_account_id,
issuer: mhv_sts_settings.issuer,
private_key_path: Settings.sign_in.sts_client.key_path,
scopes: sts_scopes,
user_identifier:,
user_attributes: { icn: user_identifier }
)
end
|
#sts_scopes ⇒ Object
78
79
80
|
# File 'lib/mhv/account_creation/configuration.rb', line 78
def sts_scopes
["#{base_path}/#{account_creation_path}"]
end
|
#sts_token(user_identifier:) ⇒ Object
55
56
57
58
59
60
61
62
63
|
# File 'lib/mhv/account_creation/configuration.rb', line 55
def sts_token(user_identifier:)
token = sts_client(user_identifier).token
Rails.logger.info("#{logging_prefix} sts token request success", user_identifier:)
token
rescue SignInService::Error => e
error_message = e.message
Rails.logger.error("#{logging_prefix} sts token request failed", user_identifier:, error_message:)
raise Common::Client::Errors::ClientError, error_message
end
|
#tou_doc_title ⇒ Object
37
38
39
|
# File 'lib/mhv/account_creation/configuration.rb', line 37
def tou_doc_title
'VA Enterprise Terms of Use'
end
|
#tou_legal_version ⇒ Object
33
34
35
|
# File 'lib/mhv/account_creation/configuration.rb', line 33
def tou_legal_version
'1.0'
end
|
#tou_revision ⇒ Object
29
30
31
|
# File 'lib/mhv/account_creation/configuration.rb', line 29
def tou_revision
'3'
end
|
#tou_status ⇒ Object
25
26
27
|
# File 'lib/mhv/account_creation/configuration.rb', line 25
def tou_status
'accepted'
end
|