From b4e091b4d4269d9ad2b3cb7adcb20184305127f5 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 29 Nov 2019 10:28:50 +0100 Subject: [PATCH] Add default values to core API configuration [SCI-4098] --- config/initializers/api.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/initializers/api.rb b/config/initializers/api.rb index 5fcd444ab..e49c585a8 100644 --- a/config/initializers/api.rb +++ b/config/initializers/api.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true Rails.application.configure do - config.x.core_api_sign_alg = ENV['CORE_API_SIGN_ALG'] if ENV['CORE_API_SIGN_ALG'] + config.x.core_api_sign_alg = ENV['CORE_API_SIGN_ALG'] || 'HS256' - config.x.core_api_token_ttl = ENV['CORE_API_TOKEN_TTL'].to_i.seconds if ENV['CORE_API_TOKEN_TTL'] + config.x.core_api_token_ttl = ENV['CORE_API_TOKEN_TTL'] ? ENV['CORE_API_TOKEN_TTL'].to_i.seconds : 30.minutes - config.x.core_api_token_iss = ENV['CORE_API_TOKEN_ISS'] if ENV['CORE_API_TOKEN_ISS'] + config.x.core_api_token_iss = ENV['CORE_API_TOKEN_ISS'] || 'SciNote' config.x.core_api_rate_limit = ENV['CORE_API_RATE_LIMIT'] ? ENV['CORE_API_RATE_LIMIT'].to_i : 1000 - config.x.core_api_v1_enabled = true if ENV['CORE_API_V1_ENABLED'] + config.x.core_api_v1_enabled = ENV['CORE_API_V1_ENABLED'] || false end