vault: Track the token store in core
This commit is contained in:
parent
56d99fe580
commit
879a0501f8
|
@ -202,6 +202,11 @@ func (c *Core) setupCredentials() error {
|
|||
c.logger.Printf("[ERR] core: failed to mount auth entry %#v: %v", entry, err)
|
||||
return loadAuthFailed
|
||||
}
|
||||
|
||||
// Check if this is the token store
|
||||
if entry.Type == "token" {
|
||||
c.tokenStore = backend.(*TokenStore)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -210,6 +215,7 @@ func (c *Core) setupCredentials() error {
|
|||
// backends to their unloaded state. This is reversed by loadCredentials.
|
||||
func (c *Core) teardownCredentials() error {
|
||||
c.auth = nil
|
||||
c.tokenStore = nil
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -136,6 +136,9 @@ type Core struct {
|
|||
// policy store is used to manage named ACL policies
|
||||
policy *PolicyStore
|
||||
|
||||
// token store is used to manage authentication tokens
|
||||
tokenStore *TokenStore
|
||||
|
||||
logger *log.Logger
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue