Class: Vault::AuthToken
Instance Attribute Summary
Attributes inherited from Request
Instance Method Summary collapse
-
#create(options = {}) ⇒ Secret
Create an authentication token.
-
#renew(id, increment = 0) ⇒ Secret
Renew the given authentication token.
-
#revoke_orphan(id) ⇒ true
Revoke exactly the orphans at the id.
-
#revoke_prefix(prefix) ⇒ true
Revoke all auth at the given prefix.
-
#revoke_tree(id) ⇒ true
Revoke all auths in the tree.
Methods inherited from Request
Constructor Details
This class inherits a constructor from Vault::Request
Instance Method Details
#create(options = {}) ⇒ Secret
Create an authentication token.
26 27 28 29 |
# File 'lib/vault/api/auth_token.rb', line 26 def create( = {}) json = client.post("/v1/auth/token/create", JSON.fast_generate()) return Secret.decode(json) end |
#renew(id, increment = 0) ⇒ Secret
Renew the given authentication token.
41 42 43 44 45 46 |
# File 'lib/vault/api/auth_token.rb', line 41 def renew(id, increment = 0) json = client.put("/v1/auth/token/renew/#{id}", JSON.fast_generate( increment: increment, )) return Secret.decode(json) end |
#revoke_orphan(id) ⇒ true
Revoke exactly the orphans at the id.
57 58 59 60 |
# File 'lib/vault/api/auth_token.rb', line 57 def revoke_orphan(id) client.put("/v1/auth/token/revoke-orphan/#{id}", nil) return true end |
#revoke_prefix(prefix) ⇒ true
Revoke all auth at the given prefix.
71 72 73 74 |
# File 'lib/vault/api/auth_token.rb', line 71 def revoke_prefix(prefix) client.put("/v1/auth/token/revoke-prefix/#{prefix}", nil) return true end |
#revoke_tree(id) ⇒ true
Revoke all auths in the tree.
85 86 87 88 |
# File 'lib/vault/api/auth_token.rb', line 85 def revoke_tree(id) client.put("/v1/auth/token/revoke/#{id}", nil) return true end |