Bootstrap ensures the target bucket exists and synchronizes data from the object storage backend.
(ctx context.Context, exampleConfigPath string)
| 140 | |
| 141 | // Bootstrap ensures the target bucket exists and synchronizes data from the object storage backend. |
| 142 | func (s *ObjectTokenStore) Bootstrap(ctx context.Context, exampleConfigPath string) error { |
| 143 | if s == nil { |
| 144 | return fmt.Errorf("object store: not initialized") |
| 145 | } |
| 146 | if err := s.ensureBucket(ctx); err != nil { |
| 147 | return err |
| 148 | } |
| 149 | if err := s.syncConfigFromBucket(ctx, exampleConfigPath); err != nil { |
| 150 | return err |
| 151 | } |
| 152 | if err := s.syncAuthFromBucket(ctx); err != nil { |
| 153 | return err |
| 154 | } |
| 155 | return nil |
| 156 | } |
| 157 | |
| 158 | // Save persists authentication metadata to disk and uploads it to the object storage backend. |
| 159 | func (s *ObjectTokenStore) Save(ctx context.Context, auth *cliproxyauth.Auth) (string, error) { |
nothing calls this directly
no test coverage detected