From cf4bbb0d0ab6ee79035890969ff964fd7993e506 Mon Sep 17 00:00:00 2001 From: Sarai Rosenberg Date: Tue, 2 Jun 2020 20:41:28 -0700 Subject: [PATCH] Add accessor to sys.auths response --- lib/vault/api/sys/auth.rb | 7 ++++++- spec/integration/api/sys/auth_spec.rb | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/vault/api/sys/auth.rb b/lib/vault/api/sys/auth.rb index ad827cac..48872b22 100644 --- a/lib/vault/api/sys/auth.rb +++ b/lib/vault/api/sys/auth.rb @@ -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 @@ -29,7 +34,7 @@ class Sys # List all auths in Vault. # # @example - # Vault.sys.auths #=> {:token => #} + # Vault.sys.auths #=> {:token => #} # # @return [Hash] def auths diff --git a/spec/integration/api/sys/auth_spec.rb b/spec/integration/api/sys/auth_spec.rb index d3c3b899..ff4094cd 100644 --- a/spec/integration/api/sys/auth_spec.rb +++ b/spec/integration/api/sys/auth_spec.rb @@ -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