vault: Track the token store in core

This commit is contained in:
Armon Dadgar 2015-03-23 13:41:05 -07:00
parent 56d99fe580
commit 879a0501f8
2 changed files with 9 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}