lib/domoscio_rails.rb in domoscio_rails-0.2.19 vs lib/domoscio_rails.rb in domoscio_rails-0.2.23
- old
+ new
@@ -33,21 +33,22 @@
require 'domoscio_rails/metadata/tagging'
require 'domoscio_rails/metadata/tag_set'
require 'domoscio_rails/metadata/tag_edge'
require 'domoscio_rails/data/knowledge_node_student'
require 'domoscio_rails/data/event'
+require 'domoscio_rails/data/learning_session'
require 'domoscio_rails/utils/review_util'
require 'domoscio_rails/utils/gameplay_util'
require 'domoscio_rails/utils/alerts_util'
require 'domoscio_rails/utils/recommendation_util'
require 'domoscio_rails/metadata/delta_object'
module DomoscioRails
class Configuration
attr_accessor :preproduction, :test, :dev, :root_url,
- :client_id, :client_passphrase,
+ :client_id, :client_passphrase, :client_identifier,
:temp_dir, :disabled, :version
def disabled
@disabled || false
end
@@ -69,15 +70,15 @@
end
def root_url
if @preproduction == true
if @test == true
- @root_url || "https://domoscio-adaptive-engine-staging.azurewebsites.net"
+ @root_url || "https://staging.adaptive-engine.domoscio.com"
elsif @dev == true
- @root_url || "https://domoscio-adaptive-engine-preprod.azurewebsites.net"
+ @root_url || "https://preprod.adaptive-engine.domoscio.com"
else
- @root_url || "https://domoscio-adaptive-engine.azurewebsites.net"
+ @root_url || "https://adaptive-engine.domoscio.com"
end
else
@root_url || "http://localhost:3001"
end
end
@@ -191,10 +192,11 @@
'uname lookup failed'
end
def self.request_headers
auth_token = DomoscioRails::AuthorizationToken::Manager.get_token
+ client_identifier = DomoscioRails.configuration.client_identifier
if !auth_token.is_a? String
headers = {
'user_agent' => "DomoscioRails V2 RubyBindings/#{DomoscioRails::VERSION}",
'AccessToken' => "#{auth_token[:access_token]}",
@@ -206,9 +208,11 @@
'user_agent' => "DomoscioRails V2 RubyBindings/#{DomoscioRails::VERSION}",
'Authorization' => "Token token=#{DomoscioRails.configuration.client_passphrase}",#"#{auth_token['token_type']} #{auth_token['access_token']}",
'Content-Type' => 'application/json'
}
end
+ headers['VizToken'] = client_identifier if !client_identifier.nil?
+
headers
end