(auths []*coreauth.Auth)
| 163 | } |
| 164 | |
| 165 | func 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 | |
| 181 | func ensureAccessToken(ctx context.Context, store *sdkauth.FileTokenStore, auth *coreauth.Auth) (string, bool, error) { |
| 182 | accessToken := metaStringValue(auth.Metadata, "access_token") |
no test coverage detected