Skip to content

Commit

Permalink
Invalidate client after rotating root credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
F21 committed Mar 26, 2024
1 parent 35f70fc commit f12bb1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (b *backblazeB2Backend) reset() {
}

func (b *backblazeB2Backend) invalidate(_ context.Context, key string) {
if key == "config" {
if key == configStoragePath {
b.reset()
}
}
2 changes: 2 additions & 0 deletions path_config_rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (b *backblazeB2Backend) pathConfigRotateRootUpdate(ctx context.Context, req
return nil, fmt.Errorf("failed to generate JSON configuration: %w", err)
}

b.reset()

// And store it
if err := req.Storage.Put(ctx, entry); err != nil {
return nil, fmt.Errorf("failed to persist configuration: %w", err)
Expand Down

0 comments on commit f12bb1b

Please sign in to comment.