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

Function authHasOAuthMetadata

sdk/cliproxy/auth/classification.go:106–119  ·  view source on GitHub ↗
(auth *Auth)

Source from the content-addressed store, hash-verified

104}
105
106func authHasOAuthMetadata(auth *Auth) bool {
107 if auth == nil || len(auth.Metadata) == 0 {
108 return false
109 }
110 for _, key := range []string{"access_token", "refresh_token", "id_token", "email", "token_type", "expires_at", "expired"} {
111 if authMetadataString(auth, key) != "" {
112 return true
113 }
114 }
115 if token, ok := auth.Metadata["token"].(map[string]any); ok && len(token) > 0 {
116 return true
117 }
118 return false
119}
120
121func authAttribute(auth *Auth, key string) string {
122 if auth == nil || auth.Attributes == nil {

Callers 1

AuthKindMethod · 0.85

Calls 1

authMetadataStringFunction · 0.85

Tested by

no test coverage detected