open-vault/logical/auth.go

37 lines
1015 B
Go
Raw Normal View History

package logical
2015-04-01 22:08:43 +00:00
import (
"fmt"
2015-04-03 00:25:22 +00:00
"time"
2015-04-01 22:08:43 +00:00
)
// Auth is the resulting authentication information that is part of
// Response for credential backends.
type Auth struct {
2015-03-31 03:26:39 +00:00
// 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
// Policies is the list of policies that the authenticated user
// is associated with.
Policies []string
// 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
2015-04-03 00:25:22 +00:00
// Lease is the duration that this token is valid for. Vault
// will automatically revoke it after the duration + grace period.
Lease time.Duration
LeaseGracePeriod time.Duration
// Renewable, if true, means that this token can be renewed.
Renewable bool
}
2015-04-01 22:08:43 +00:00
func (a *Auth) GoString() string {
return fmt.Sprintf("*%#v", *a)
}