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

Method Delete

sdk/auth/filestore.go:198–211  ·  view source on GitHub ↗

Delete removes the auth file.

(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

196
197// Delete removes the auth file.
198func (s *FileTokenStore) Delete(ctx context.Context, id string) error {
199 id = strings.TrimSpace(id)
200 if id == "" {
201 return fmt.Errorf("auth filestore: id is empty")
202 }
203 path, err := s.resolveDeletePath(id)
204 if err != nil {
205 return err
206 }
207 if err = os.Remove(path); err != nil && !os.IsNotExist(err) {
208 return fmt.Errorf("auth filestore: delete failed: %w", err)
209 }
210 return nil
211}
212
213func (s *FileTokenStore) resolveDeletePath(id string) (string, error) {
214 if strings.ContainsRune(id, os.PathSeparator) || filepath.IsAbs(id) {

Callers

nothing calls this directly

Calls 2

resolveDeletePathMethod · 0.95
RemoveMethod · 0.80

Tested by

no test coverage detected