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

Function extractAccessToken

sdk/auth/filestore.go:439–453  ·  view source on GitHub ↗
(metadata map[string]any)

Source from the content-addressed store, hash-verified

437}
438
439func extractAccessToken(metadata map[string]any) string {
440 if at, ok := metadata["access_token"].(string); ok {
441 if v := strings.TrimSpace(at); v != "" {
442 return v
443 }
444 }
445 if tokenMap, ok := metadata["token"].(map[string]any); ok {
446 if at, ok := tokenMap["access_token"].(string); ok {
447 if v := strings.TrimSpace(at); v != "" {
448 return v
449 }
450 }
451 }
452 return ""
453}
454
455// jsonEqual compares two JSON blobs by parsing them into Go objects and deep comparing.
456func jsonEqual(a, b []byte) bool {

Callers 2

TestExtractAccessTokenFunction · 0.85
readAuthFilesMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestExtractAccessTokenFunction · 0.68