vault: Adding hooks for auth loading
This commit is contained in:
parent
21b9bdaf37
commit
d2d1822931
|
@ -0,0 +1,13 @@
|
|||
package vault
|
||||
|
||||
// setupCredentials is invoked after we've loaded the mount table to
|
||||
// initialize the credential backends and setup the router
|
||||
func (c *Core) setupCredentials() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// teardownCredentials is used before we seal the vault to reset the credential
|
||||
// backends to their unloaded state. This is reversed by loadCredentials.
|
||||
func (c *Core) teardownCredentials() error {
|
||||
return nil
|
||||
}
|
|
@ -492,12 +492,18 @@ func (c *Core) postUnseal() error {
|
|||
if err := c.setupTokenStore(); err != nil {
|
||||
return nil
|
||||
}
|
||||
if err := c.setupCredentials(); err != nil {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// preSeal is invoked before the barrier is sealed, allowing
|
||||
// for any state teardown required.
|
||||
func (c *Core) preSeal() error {
|
||||
if err := c.teardownCredentials(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := c.teardownTokenStore(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue