Skip to content

Commit

Permalink
Merge pull request #7733 from jorgemarey/b-vault-policies
Browse files Browse the repository at this point in the history
Fix get all vault token policies
  • Loading branch information
shoenig authored Jul 9, 2020
2 parents 9245f71 + 8de6c26 commit e48927c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions nomad/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -1061,15 +1061,7 @@ func (v *vaultClient) LookupToken(ctx context.Context, token string) (*vapi.Secr

// PoliciesFrom parses the set of policies returned by a token lookup.
func PoliciesFrom(s *vapi.Secret) ([]string, error) {
if s == nil {
return nil, fmt.Errorf("cannot parse nil Vault secret")
}
var data tokenData
if err := mapstructure.WeakDecode(s.Data, &data); err != nil {
return nil, fmt.Errorf("failed to parse Vault token's data block: %v", err)
}

return data.Policies, nil
return s.TokenPolicies()
}

// RevokeTokens revokes the passed set of accessors. If committed is set, the
Expand Down

0 comments on commit e48927c

Please sign in to comment.