diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index 9b26a8c33..1222b5283 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -83,7 +83,8 @@ class Registrar::SessionsController < Devise::SessionsController def mid phone = params[:user][:phone] - client = Rails.env.production? ? Digidoc::Client.new('https://digidocservice.sk.ee') : Digidoc::Client.new + endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" + client = Digidoc::Client.new(endpoint) if Rails.env.test? && phone == "123" @user = ApiUser.find_by(identity_code: "14212128025") @@ -119,7 +120,8 @@ class Registrar::SessionsController < Devise::SessionsController # rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/MethodLength def mid_status - client = Rails.env.production? ? Digidoc::Client.new('https://digidocservice.sk.ee') : Digidoc::Client.new + endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" + client = Digidoc::Client.new(endpoint) client.session_code = session[:mid_session_code] auth_status = client.authentication_status diff --git a/config/application-example.yml b/config/application-example.yml index f89a2b708..dae4555fb 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -7,7 +7,7 @@ legal_documents_dir: 'import/legal_documents' # New Relic app name, keep only current mode, remove other names. # Example: 'Admin, EPP, REPP' will have name 'Admin, EPP, REPP - production' at New Relic. -new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant' +new_relic_app_name: 'Admin, EPP, REPP, Registrar, Registrant' # You can use `rake secret` to generate a secure secret key. # Your secret key is used for verifying the integrity of signed cookies. @@ -58,6 +58,9 @@ smtp_enable_starttls_auto: 'true' # 'false' smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5' registrant_url: 'https:/registrant.example.com' # for valid email body registrant links +# SK DigiDocService +sk_digi_doc_service_endpoint: 'https://openxades.org:9443/DigiDocService' + # Autotest config overwrites test: webclient_ip: '127.0.0.1' # it should match to localhost ip address