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

Method upsertAuthRecord

internal/pluginhost/auth_callbacks.go:358–370  ·  view source on GitHub ↗
(ctx context.Context, auth *coreauth.Auth)

Source from the content-addressed store, hash-verified

356}
357
358func (h *Host) upsertAuthRecord(ctx context.Context, auth *coreauth.Auth) error {
359 manager := h.currentAuthManager()
360 if manager == nil || auth == nil {
361 return nil
362 }
363 if existing, ok := manager.GetByID(auth.ID); ok {
364 auth.CreatedAt = existing.CreatedAt
365 _, errUpdate := manager.Update(ctx, auth)
366 return errUpdate
367 }
368 _, errRegister := manager.Register(ctx, auth)
369 return errRegister
370}
371
372func isUnsafeAuthFileName(name string) bool {
373 if strings.TrimSpace(name) == "" {

Callers 1

saveAuthFileMethod · 0.95

Calls 4

currentAuthManagerMethod · 0.95
GetByIDMethod · 0.80
UpdateMethod · 0.45
RegisterMethod · 0.45

Tested by

no test coverage detected