Class: VIISP::Auth::Configuration
- Inherits:
-
Object
- Object
- VIISP::Auth::Configuration
- Defined in:
- lib/viisp/auth/configuration.rb
Constant Summary collapse
- CERTS_PATH =
File.('../../../../certs', __FILE__).freeze
- DEFAULT_PROVIDERS =
%w[ auth.lt.identity.card auth.lt.bank auth.signatureProvider auth.login.pass auth.lt.government.employee.card auth.stork auth.tsl.identity.card ].freeze
- DEFAULT_ATTRIBUTES =
%w[ lt-personal-code lt-company-code lt-government-employee-code stork-eid tsl-serial-number login ].freeze
- DEFAULT_USER_INFORMATION =
%w[ firstName lastName address email phoneNumber birthday companyName ].freeze
- PRODUCTION_ENDPOINT =
'https://www.epaslaugos.lt/portal/authenticationServices/auth'- PRODUCTION_PORTAL_ENDPOINT =
'https://www.epaslaugos.lt/portal/external/services/authentication/v2/'- TEST_PID =
'VSID000000000113'- TEST_ENDPOINT =
'https://www.epaslaugos.lt/portal-test/services/AuthenticationServiceProxy'- TEST_PORTAL_ENDPOINT =
'https://www.epaslaugos.lt/portal-test/external/services/authentication/v2/'- DEFAULT_OPEN_TIMEOUT =
3- DEFAULT_READ_TIMEOUT =
10
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
- #endpoint ⇒ Object
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
- #pid ⇒ Object
- #portal_endpoint ⇒ Object
- #postback_url ⇒ Object
- #private_key ⇒ Object
-
#providers ⇒ Object
Returns the value of attribute providers.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
- #service_cert ⇒ Object
-
#test ⇒ Object
writeonly
Sets the attribute test.
-
#user_information ⇒ Object
Returns the value of attribute user_information.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #test? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
62 63 64 65 66 67 68 69 |
# File 'lib/viisp/auth/configuration.rb', line 62 def initialize @providers = DEFAULT_PROVIDERS @attributes = DEFAULT_ATTRIBUTES @user_information = DEFAULT_USER_INFORMATION @open_timeout = DEFAULT_OPEN_TIMEOUT @read_timeout = DEFAULT_READ_TIMEOUT end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
15 16 17 |
# File 'lib/viisp/auth/configuration.rb', line 15 def attributes @attributes end |
#endpoint ⇒ Object
81 82 83 84 85 |
# File 'lib/viisp/auth/configuration.rb', line 81 def endpoint return @endpoint if @endpoint return TEST_ENDPOINT if test? PRODUCTION_ENDPOINT end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
19 20 21 |
# File 'lib/viisp/auth/configuration.rb', line 19 def open_timeout @open_timeout end |
#pid ⇒ Object
71 72 73 74 75 |
# File 'lib/viisp/auth/configuration.rb', line 71 def pid return @pid if @pid return TEST_PID if test? error('pid not configured') end |
#portal_endpoint ⇒ Object
87 88 89 90 91 |
# File 'lib/viisp/auth/configuration.rb', line 87 def portal_endpoint return @portal_endpoint if @portal_endpoint return TEST_PORTAL_ENDPOINT if test? PRODUCTION_PORTAL_ENDPOINT end |
#postback_url ⇒ Object
77 78 79 |
# File 'lib/viisp/auth/configuration.rb', line 77 def postback_url @postback_url || error('postback_url not configured') end |
#private_key ⇒ Object
93 94 95 96 97 |
# File 'lib/viisp/auth/configuration.rb', line 93 def private_key return @private_key if @private_key return test_private_key if test? error('private key not configured') end |
#providers ⇒ Object
Returns the value of attribute providers.
14 15 16 |
# File 'lib/viisp/auth/configuration.rb', line 14 def providers @providers end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
18 19 20 |
# File 'lib/viisp/auth/configuration.rb', line 18 def read_timeout @read_timeout end |
#service_cert ⇒ Object
99 100 101 |
# File 'lib/viisp/auth/configuration.rb', line 99 def service_cert @service_cert || builtin_service_cert end |
#test=(value) ⇒ Object (writeonly)
Sets the attribute test
10 11 12 |
# File 'lib/viisp/auth/configuration.rb', line 10 def test=(value) @test = value end |
#user_information ⇒ Object
Returns the value of attribute user_information.
16 17 18 |
# File 'lib/viisp/auth/configuration.rb', line 16 def user_information @user_information end |
Instance Method Details
#test? ⇒ Boolean
103 104 105 |
# File 'lib/viisp/auth/configuration.rb', line 103 def test? @test end |