Class: RestClient::Resource
- Inherits:
-
Object
- Object
- RestClient::Resource
- Extended by:
- Conjur::BuildFromResponse
- Includes:
- Conjur::Cast, Conjur::Escape, Conjur::LogSource
- Defined in:
- lib/conjur/api.rb
Direct Known Subclasses
Conjur::Deputy, Conjur::Group, Conjur::Layer, Conjur::Resource, Conjur::Role, Conjur::Secret, Conjur::User, Conjur::Variable
Instance Method Summary collapse
- #conjur_api ⇒ Object
- #core_conjur_account ⇒ Object
- #to_json(options = {}) ⇒ Object
- #token ⇒ Object
- #username ⇒ Object
Methods included from Conjur::BuildFromResponse
Methods included from Conjur::LogSource
Methods included from Conjur::Escape
#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( = {}) {} end |
#token ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/conjur/api.rb', line 63 def token = [:headers][:authorization] if && .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 [:user] || [:username] end |