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

Function CredentialFileName

internal/auth/codex/filename.go:12–27  ·  view source on GitHub ↗

CredentialFileName returns the filename used to persist Codex OAuth credentials. When planType is available (e.g. "plus", "team"), it is appended after the email as a suffix to disambiguate subscriptions.

(email, planType, hashAccountID string, includeProviderPrefix bool)

Source from the content-addressed store, hash-verified

10// When planType is available (e.g. "plus", "team"), it is appended after the email
11// as a suffix to disambiguate subscriptions.
12func CredentialFileName(email, planType, hashAccountID string, includeProviderPrefix bool) string {
13 email = strings.TrimSpace(email)
14 plan := normalizePlanTypeForFilename(planType)
15
16 prefix := ""
17 if includeProviderPrefix {
18 prefix = "codex"
19 }
20
21 if plan == "" {
22 return fmt.Sprintf("%s-%s.json", prefix, email)
23 } else if plan == "team" {
24 return fmt.Sprintf("%s-%s-%s-%s.json", prefix, hashAccountID, email, plan)
25 }
26 return fmt.Sprintf("%s-%s-%s.json", prefix, email, plan)
27}
28
29func normalizePlanTypeForFilename(planType string) string {
30 planType = strings.TrimSpace(planType)

Callers 2

RequestCodexTokenMethod · 0.92
buildAuthRecordMethod · 0.92

Calls 1

Tested by

no test coverage detected