Class: Mediaflux::LogonRequest

Inherits:
Request
  • Object
show all
Defined in:
app/models/mediaflux/logon_request.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

build_post_request, default_xml_namespace, default_xml_namespace_uri, #error?, find_or_create_http_client, format_date_for_mediaflux, request_path, #resolve, #resolved?, #response_body, #response_error, #response_xml, uri, #xml_payload, #xtoshell_xml

Constructor Details

#initialize(domain: self.class.mediaflux_domain, user: self.class.mediaflux_user, password: self.class.mediaflux_password, identity_token: nil, token_type: nil) ⇒ LogonRequest

Returns a new instance of LogonRequest.



28
29
30
31
32
33
34
35
# File 'app/models/mediaflux/logon_request.rb', line 28

def initialize(domain: self.class.mediaflux_domain, user: self.class.mediaflux_user, password: self.class.mediaflux_password, identity_token: nil, token_type: nil)
  @domain = domain
  @user = user
  @password = password
  @identity_token = identity_token
  @token_type = token_type
  super()
end

Class Method Details

.mediafluxHash

The Rails configuration options specifying the Mediaflux server

Returns:

  • (Hash)


49
50
51
# File 'app/models/mediaflux/logon_request.rb', line 49

def mediaflux
  Rails.configuration.mediaflux
end

.mediaflux_domainString

Specifies the user domain for the Mediaflux API authentication

Returns:

  • (String)


12
13
14
# File 'app/models/mediaflux/logon_request.rb', line 12

def self.mediaflux_domain
  mediaflux["api_domain"]
end

.mediaflux_passwordString

Specifies the password for the Mediaflux API authentication

Returns:

  • (String)


24
25
26
# File 'app/models/mediaflux/logon_request.rb', line 24

def self.mediaflux_password
  mediaflux["api_password"]
end

.mediaflux_userString

Specifies the user for the Mediaflux API authentication

Returns:

  • (String)


18
19
20
# File 'app/models/mediaflux/logon_request.rb', line 18

def self.mediaflux_user
  mediaflux["api_user"]
end

.serviceString

Specifies the logon service within the Mediaflux API

Returns:

  • (String)


6
7
8
# File 'app/models/mediaflux/logon_request.rb', line 6

def self.service
  "system.logon"
end

Instance Method Details

#session_tokenString

Authenticates the Mediaflux API using the credentials set within the Rails configuration, and set the token for the API session if the request has not already been resolved

Returns:

  • (String)

    the session token generated by the Mediaflux API



40
41
42
# File 'app/models/mediaflux/logon_request.rb', line 40

def session_token
  @session_token ||= response_session_token
end