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

Method refreshAuthState

internal/watcher/dispatcher.go:125–143  ·  view source on GitHub ↗
(force bool)

Source from the content-addressed store, hash-verified

123}
124
125func (w *Watcher) refreshAuthState(force bool) {
126 w.clientsMutex.RLock()
127 cfg := w.config
128 authDir := w.authDir
129 parser := w.pluginAuthParser
130 w.clientsMutex.RUnlock()
131 auths := snapshotCoreAuthsFunc(cfg, authDir, parser)
132 w.clientsMutex.Lock()
133 if len(w.runtimeAuths) > 0 {
134 for _, a := range w.runtimeAuths {
135 if a != nil {
136 auths = append(auths, a.Clone())
137 }
138 }
139 }
140 updates := w.prepareAuthUpdatesLocked(auths, force)
141 w.clientsMutex.Unlock()
142 w.dispatchAuthUpdates(updates)
143}
144
145func (w *Watcher) prepareAuthUpdatesLocked(auths []*coreauth.Auth, force bool) []AuthUpdate {
146 newState := make(map[string]*coreauth.Auth, len(auths))

Callers 2

reloadClientsMethod · 0.95

Calls 3

dispatchAuthUpdatesMethod · 0.95
CloneMethod · 0.45