mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
AppRole authentication backend
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package logical
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Auth is the resulting authentication information that is part of
|
||||
// Response for credential backends.
|
||||
@@ -10,7 +13,7 @@ type Auth struct {
|
||||
// InternalData is JSON-encodable data that is stored with the auth struct.
|
||||
// This will be sent back during a Renew/Revoke for storing internal data
|
||||
// used for those operations.
|
||||
InternalData map[string]interface{}
|
||||
InternalData map[string]interface{} `json:"internal_data" mapstructure:"internal_data" structs:"internal_data"`
|
||||
|
||||
// DisplayName is a non-security sensitive identifier that is
|
||||
// applicable to this Auth. It is used for logging and prefixing
|
||||
@@ -18,28 +21,33 @@ type Auth struct {
|
||||
// the github credential backend. If the client token is used to
|
||||
// generate a SQL credential, the user may be "github-armon-uuid".
|
||||
// This is to help identify the source without using audit tables.
|
||||
DisplayName string
|
||||
DisplayName string `json:"display_name" mapstructure:"display_name" structs:"display_name"`
|
||||
|
||||
// Policies is the list of policies that the authenticated user
|
||||
// is associated with.
|
||||
Policies []string
|
||||
Policies []string `json:"policies" mapstructure:"policies" structs:"policies"`
|
||||
|
||||
// Metadata is used to attach arbitrary string-type metadata to
|
||||
// an authenticated user. This metadata will be outputted into the
|
||||
// audit log.
|
||||
Metadata map[string]string
|
||||
Metadata map[string]string `json:"metadata" mapstructure:"metadata" structs:"metadata"`
|
||||
|
||||
// ClientToken is the token that is generated for the authentication.
|
||||
// This will be filled in by Vault core when an auth structure is
|
||||
// returned. Setting this manually will have no effect.
|
||||
ClientToken string
|
||||
ClientToken string `json:"client_token" mapstructure:"client_token" structs:"client_token"`
|
||||
|
||||
// Accessor is the identifier for the ClientToken. This can be used
|
||||
// to perform management functionalities (especially revocation) when
|
||||
// ClientToken in the audit logs are obfuscated. Accessor can be used
|
||||
// to revoke a ClientToken and to lookup the capabilities of the ClientToken,
|
||||
// both without actually knowing the ClientToken.
|
||||
Accessor string
|
||||
Accessor string `json:"accessor" mapstructure:"accessor" structs:"accessor"`
|
||||
|
||||
// Period indicates that the token generated using this Auth object
|
||||
// should never expire. The token should be renewed within the duration
|
||||
// specified by this period.
|
||||
Period time.Duration `json:"period" mapstructure:"period" structs:"period"`
|
||||
}
|
||||
|
||||
func (a *Auth) GoString() string {
|
||||
|
||||
Reference in New Issue
Block a user