Class: RestClient::Resource
Instance Method Summary
collapse
build_from_response
#log
#fully_escape, included, #path_escape, #query_escape
Instance Method Details
#conjur_api ⇒ Object
59
60
61
|
# File 'lib/conjur/api.rb', line 59
def conjur_api
Conjur::API.new_from_token token
end
|
#core_conjur_account ⇒ Object
51
52
53
|
# File 'lib/conjur/api.rb', line 51
def core_conjur_account
Conjur::Core::API.conjur_account
end
|
#to_json(options = {}) ⇒ Object
55
56
57
|
# File 'lib/conjur/api.rb', line 55
def to_json(options = {})
{}
end
|
#token ⇒ Object
63
64
65
66
67
68
69
70
|
# File 'lib/conjur/api.rb', line 63
def token
authorization = options[:headers][:authorization]
if authorization && authorization.to_s[/^Token token="(.*)"/]
JSON.parse(Base64.decode64($1))
else
raise AuthorizationError.new("Authorization missing")
end
end
|
#username ⇒ Object
72
73
74
|
# File 'lib/conjur/api.rb', line 72
def username
options[:user] || options[:username]
end
|