Delete removes an auth file locally and remotely.
(ctx context.Context, id string)
| 269 | |
| 270 | // Delete removes an auth file locally and remotely. |
| 271 | func (s *ObjectTokenStore) Delete(ctx context.Context, id string) error { |
| 272 | id = strings.TrimSpace(id) |
| 273 | if id == "" { |
| 274 | return fmt.Errorf("object store: id is empty") |
| 275 | } |
| 276 | path, err := s.resolveDeletePath(id) |
| 277 | if err != nil { |
| 278 | return err |
| 279 | } |
| 280 | |
| 281 | s.mu.Lock() |
| 282 | defer s.mu.Unlock() |
| 283 | |
| 284 | if err = os.Remove(path); err != nil && !errors.Is(err, fs.ErrNotExist) { |
| 285 | return fmt.Errorf("object store: delete auth file: %w", err) |
| 286 | } |
| 287 | if err = s.deleteAuthObject(ctx, path); err != nil { |
| 288 | return err |
| 289 | } |
| 290 | return nil |
| 291 | } |
| 292 | |
| 293 | // PersistAuthFiles uploads the provided auth files to the object storage backend. |
| 294 | func (s *ObjectTokenStore) PersistAuthFiles(ctx context.Context, _ string, paths ...string) error { |
nothing calls this directly
no test coverage detected