Class: EtCcdClient::TidamClient

Inherits:
Object
  • Object
show all
Defined in:
lib/et_ccd_client/tidam_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: ::EtCcdClient.config) ⇒ TidamClient

Returns a new instance of TidamClient.



9
10
11
12
13
14
15
# File 'lib/et_ccd_client/tidam_client.rb', line 9

def initialize(config: ::EtCcdClient.config)
  self.config = config
  self.logger = config.logger
  self.service_token = nil
  self.user_token = nil
  self.user_details = nil
end

Instance Attribute Details

#service_tokenObject

Returns the value of attribute service_token.



7
8
9
# File 'lib/et_ccd_client/tidam_client.rb', line 7

def service_token
  @service_token
end

#user_detailsObject

Returns the value of attribute user_details.



7
8
9
# File 'lib/et_ccd_client/tidam_client.rb', line 7

def user_details
  @user_details
end

#user_tokenObject

Returns the value of attribute user_token.



7
8
9
# File 'lib/et_ccd_client/tidam_client.rb', line 7

def user_token
  @user_token
end

Instance Method Details

#login(user_id: config.user_id, role: config.user_role) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/et_ccd_client/tidam_client.rb', line 17

def (user_id: config.user_id, role: config.user_role)
  logger.tagged('EtCcdClient::IdamClient') do
    self.service_token = exchange_service_token
    self.user_token = exchange_tidam_user_token(user_id, role)
    self.user_details = get_user_details(user_id, role)
  end
end