Use proper context in authority package

This commit is contained in:
Mariano Cano 2022-05-23 15:31:43 -07:00
parent 539bfddba5
commit 94f5b92513
2 changed files with 3 additions and 2 deletions

View file

@ -590,7 +590,7 @@ func (a *Authority) init() error {
} }
// Load Provisioners and Admins // Load Provisioners and Admins
if err := a.ReloadAdminResources(context.Background()); err != nil { if err := a.ReloadAdminResources(ctx); err != nil {
return err return err
} }

View file

@ -253,7 +253,8 @@ func (a *Authority) authorizeSign(ctx context.Context, token string) ([]provisio
// //
// Deprecated: Use Authorize(context.Context, string) ([]provisioner.SignOption, error). // Deprecated: Use Authorize(context.Context, string) ([]provisioner.SignOption, error).
func (a *Authority) AuthorizeSign(token string) ([]provisioner.SignOption, error) { func (a *Authority) AuthorizeSign(token string) ([]provisioner.SignOption, error) {
ctx := provisioner.NewContextWithMethod(context.Background(), provisioner.SignMethod) ctx := NewContext(context.Background(), a)
ctx = provisioner.NewContextWithMethod(ctx, provisioner.SignMethod)
return a.Authorize(ctx, token) return a.Authorize(ctx, token)
} }