MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / PersistAuthFiles

Method PersistAuthFiles

internal/store/objectstore.go:294–316  ·  view source on GitHub ↗

PersistAuthFiles uploads the provided auth files to the object storage backend.

(ctx context.Context, _ string, paths ...string)

Source from the content-addressed store, hash-verified

292
293// PersistAuthFiles uploads the provided auth files to the object storage backend.
294func (s *ObjectTokenStore) PersistAuthFiles(ctx context.Context, _ string, paths ...string) error {
295 if len(paths) == 0 {
296 return nil
297 }
298
299 s.mu.Lock()
300 defer s.mu.Unlock()
301
302 for _, p := range paths {
303 trimmed := strings.TrimSpace(p)
304 if trimmed == "" {
305 continue
306 }
307 abs := trimmed
308 if !filepath.IsAbs(abs) {
309 abs = filepath.Join(s.authDir, trimmed)
310 }
311 if err := s.uploadAuth(ctx, abs); err != nil {
312 return err
313 }
314 }
315 return nil
316}
317
318// PersistConfig uploads the local configuration file to the object storage backend.
319func (s *ObjectTokenStore) PersistConfig(ctx context.Context) error {

Callers

nothing calls this directly

Calls 1

uploadAuthMethod · 0.95

Tested by

no test coverage detected