Class: Barong::ManagementAPIV2::Client
Instance Attribute Summary
#action
Instance Method Summary
collapse
#build_path, #generate_jwt, #http_client, #keychain, #payload, #request
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
4
5
6
|
# File 'app/services/barong/management_api_v2/client.rb', line 4
def initialize(*)
super ENV.fetch('BARONG_URL'), Rails.configuration.x.barong_management_api_v2_configuration
end
|
Instance Method Details
#create_label(request_params = {}) ⇒ Object
26
27
28
29
30
|
# File 'app/services/barong/management_api_v2/client.rb', line 26
def create_label(request_params = {})
self.action = :write_labels
params = request_params.slice(:user_uid, :key, :value, :jwt)
request(:post, 'labels', params)
end
|
#get_user_info(request_params = {}) ⇒ Object
14
15
16
17
18
|
# File 'app/services/barong/management_api_v2/client.rb', line 14
def get_user_info(request_params={})
self.action = :read_users
params = request_params.slice(:uid, :extended, :jwt)
request(:post, "users/get", params)
end
|
#otp_sign(request_params = {}) ⇒ Object
8
9
10
11
12
|
# File 'app/services/barong/management_api_v2/client.rb', line 8
def otp_sign(request_params = {})
self.action = :otp_sign
params = request_params.slice(:user_uid, :otp_code, :jwt)
request(:post, 'otp/sign', params)
end
|
#update_label(request_params = {}) ⇒ Object
20
21
22
23
24
|
# File 'app/services/barong/management_api_v2/client.rb', line 20
def update_label(request_params = {})
self.action = :write_labels
params = request_params.slice(:user_uid, :key, :value, :jwt, :replace)
request(:put, 'labels', params)
end
|