Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/vault/api/sys/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class Auth < Response
# Name of the auth backend.
# @return [String]
field :type

# @!attribute [r] accessor
# Accessor of the auth backend.
# @return [String]
field :accessor
end

class AuthConfig < Response
Expand All @@ -29,7 +34,7 @@ class Sys
# List all auths in Vault.
#
# @example
# Vault.sys.auths #=> {:token => #<Vault::Auth type="token", description="token based credentials">}
# Vault.sys.auths #=> {:token => #<Vault::Auth type="token", description="token based credentials", accessor="auth_token_d73f8a39">}
#
# @return [Hash<Symbol, Auth>]
def auths
Expand Down
7 changes: 6 additions & 1 deletion spec/integration/api/sys/auth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ module Vault
subject { vault_test_client.sys }

describe "#auths" do
it "returns the list of auths" do
it "returns the list of auths with fields" do
expect(subject.auths).to be
auths = subject.auths
expect(auths[:token]).to be
expect(auths[:token].type).to eq('token')
expect(auths[:token].description).to eq('token based credentials')
expect(auths[:token].accessor).to be
end
end

Expand Down