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