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

Function authLastRefreshTimestamp

sdk/cliproxy/auth/conductor.go:5488–5507  ·  view source on GitHub ↗
(a *Auth)

Source from the content-addressed store, hash-verified

5486}
5487
5488func authLastRefreshTimestamp(a *Auth) (time.Time, bool) {
5489 if a == nil {
5490 return time.Time{}, false
5491 }
5492 if a.Metadata != nil {
5493 if ts, ok := lookupMetadataTime(a.Metadata, "last_refresh", "lastRefresh", "last_refreshed_at", "lastRefreshedAt"); ok {
5494 return ts, true
5495 }
5496 }
5497 if a.Attributes != nil {
5498 for _, key := range []string{"last_refresh", "lastRefresh", "last_refreshed_at", "lastRefreshedAt"} {
5499 if val := strings.TrimSpace(a.Attributes[key]); val != "" {
5500 if ts, ok := parseTimeValue(val); ok {
5501 return ts, true
5502 }
5503 }
5504 }
5505 }
5506 return time.Time{}, false
5507}
5508
5509func lookupMetadataTime(meta map[string]any, keys ...string) (time.Time, bool) {
5510 for _, key := range keys {

Callers 2

nextRefreshCheckAtFunction · 0.85
shouldRefreshMethod · 0.85

Calls 2

lookupMetadataTimeFunction · 0.85
parseTimeValueFunction · 0.85

Tested by

no test coverage detected