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

Struct CodexTokenStorage

internal/auth/codex/token.go:18–39  ·  view source on GitHub ↗

CodexTokenStorage stores OAuth2 token information for OpenAI Codex API authentication. It maintains compatibility with the existing auth system while adding Codex-specific fields for managing access tokens, refresh tokens, and user account information.

Source from the content-addressed store, hash-verified

16// It maintains compatibility with the existing auth system while adding Codex-specific fields
17// for managing access tokens, refresh tokens, and user account information.
18type CodexTokenStorage struct {
19 // IDToken is the JWT ID token containing user claims and identity information.
20 IDToken string `json:"id_token"`
21 // AccessToken is the OAuth2 access token used for authenticating API requests.
22 AccessToken string `json:"access_token"`
23 // RefreshToken is used to obtain new access tokens when the current one expires.
24 RefreshToken string `json:"refresh_token"`
25 // AccountID is the OpenAI account identifier associated with this token.
26 AccountID string `json:"account_id"`
27 // LastRefresh is the timestamp of the last token refresh operation.
28 LastRefresh string `json:"last_refresh"`
29 // Email is the OpenAI account email address associated with this token.
30 Email string `json:"email"`
31 // Type indicates the authentication provider type, always "codex" for this storage.
32 Type string `json:"type"`
33 // Expire is the timestamp when the current access token expires.
34 Expire string `json:"expired"`
35
36 // Metadata holds arbitrary key-value pairs injected via hooks.
37 // It is not exported to JSON directly to allow flattening during serialization.
38 Metadata map[string]any `json:"-"`
39}
40
41// SetMetadata allows external callers to inject metadata into the storage before saving.
42func (ts *CodexTokenStorage) SetMetadata(meta map[string]any) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected