2017-08-30 00:49:07 +08:00
|
|
|
module Api
|
|
|
|
class << self
|
|
|
|
attr_accessor :configuration
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.configuration
|
|
|
|
@configuration ||= Configuration.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.configure
|
|
|
|
yield(configuration)
|
|
|
|
end
|
|
|
|
|
|
|
|
class Configuration
|
|
|
|
attr_accessor :core_api_sign_alg
|
|
|
|
attr_accessor :core_api_token_ttl
|
|
|
|
attr_accessor :core_api_token_iss
|
2018-07-24 20:21:33 +08:00
|
|
|
attr_accessor :azure_ad_apps
|
2019-01-04 17:44:38 +08:00
|
|
|
attr_accessor :core_api_v1_enabled
|
2018-10-11 15:48:06 +08:00
|
|
|
attr_accessor :core_api_rate_limit
|
2017-08-30 00:49:07 +08:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
@core_api_sign_alg = 'HS256'
|
|
|
|
@core_api_token_ttl = 30.minutes
|
|
|
|
@core_api_token_iss = 'SciNote'
|
2018-07-24 20:21:33 +08:00
|
|
|
@azure_ad_apps = {}
|
2019-01-04 17:44:38 +08:00
|
|
|
@core_api_v1_enabled = false
|
2018-10-11 15:48:06 +08:00
|
|
|
@core_api_rate_limit = 1000
|
2017-08-30 00:49:07 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|