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

Method AccountInfo

sdk/cliproxy/auth/types.go:558–581  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

556}
557
558func (a *Auth) AccountInfo() (string, string) {
559 if a == nil {
560 return "", ""
561 }
562 switch a.AuthKind() {
563 case AuthKindOAuth:
564 if a.Metadata != nil {
565 if v, ok := a.Metadata["email"].(string); ok {
566 email := strings.TrimSpace(v)
567 if email != "" {
568 return "oauth", email
569 }
570 }
571 }
572 return "oauth", ""
573 case AuthKindAPIKey:
574 if apiKey := authAttribute(a, AttributeAPIKey); apiKey != "" {
575 return "api_key", apiKey
576 }
577 return "api_key", ""
578 default:
579 return "", ""
580 }
581}
582
583// ExpirationTime attempts to extract the credential expiration timestamp from metadata.
584// It inspects common keys such as "expired", "expire", "expires_at", and also

Callers 15

recordHTTPRequestMethod · 0.80
buildAuthFileEntryMethod · 0.80
GetAPIKeyUsageMethod · 0.80
proxyURLFromAPIKeyConfigFunction · 0.80
ExecuteMethod · 0.80
ExecuteStreamMethod · 0.80
CountTokensMethod · 0.80
ExecuteMethod · 0.80
executeCompactMethod · 0.80
ExecuteStreamMethod · 0.80

Calls 2

AuthKindMethod · 0.95
authAttributeFunction · 0.70

Tested by 1