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

Method runtimeAuthSyncHook

sdk/cliproxy/builder.go:299–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297}
298
299func (s *Service) runtimeAuthSyncHook() coreauth.PostAuthHook {
300 return func(ctx context.Context, auth *coreauth.Auth) error {
301 if s == nil || auth == nil || auth.ID == "" {
302 return nil
303 }
304 action := watcher.AuthUpdateActionAdd
305 if s.coreManager != nil {
306 if _, ok := s.coreManager.GetByID(auth.ID); ok {
307 action = watcher.AuthUpdateActionModify
308 }
309 }
310 update := watcher.AuthUpdate{
311 Action: action,
312 ID: auth.ID,
313 Auth: auth,
314 }
315 if s.watcher != nil && s.watcher.DispatchPersistedAuthUpdate(update) {
316 return nil
317 }
318 s.handleAuthUpdate(coreauth.WithSkipPersist(ctx), update)
319 return nil
320 }
321}

Callers 1

BuildMethod · 0.95

Calls 3

handleAuthUpdateMethod · 0.95
GetByIDMethod · 0.80

Tested by

no test coverage detected