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

Function findCodexAuth

cmd/fetch_codex_models/main.go:165–179  ·  view source on GitHub ↗
(auths []*coreauth.Auth)

Source from the content-addressed store, hash-verified

163}
164
165func findCodexAuth(auths []*coreauth.Auth) *coreauth.Auth {
166 for _, auth := range auths {
167 if auth == nil || auth.Disabled {
168 continue
169 }
170 if !strings.EqualFold(strings.TrimSpace(auth.Provider), "codex") {
171 continue
172 }
173 if metaStringValue(auth.Metadata, "access_token") == "" && metaStringValue(auth.Metadata, "refresh_token") == "" {
174 continue
175 }
176 return auth
177 }
178 return nil
179}
180
181func ensureAccessToken(ctx context.Context, store *sdkauth.FileTokenStore, auth *coreauth.Auth) (string, bool, error) {
182 accessToken := metaStringValue(auth.Metadata, "access_token")

Callers 1

mainFunction · 0.85

Calls 1

metaStringValueFunction · 0.70

Tested by

no test coverage detected