MCPcopy
hub / github.com/perkeep/perkeep / DiscoveryToken

Function DiscoveryToken

pkg/auth/auth.go:459–467  ·  view source on GitHub ↗

DiscoveryToken returns OmitAuthToken if the first registered auth mode is of type None, and Token() otherwise.

()

Source from the content-addressed store, hash-verified

457// DiscoveryToken returns OmitAuthToken if the first registered auth mode is of
458// type None, and Token() otherwise.
459func DiscoveryToken() string {
460 if len(modes) == 0 {
461 return Token()
462 }
463 if _, ok := modes[0].(None); ok {
464 return OmitAuthToken
465 }
466 return Token()
467}
468
469// TokenOrNone returns a token auth mode if token is not OmitAuthToken, and
470// otherwise a None auth mode.

Callers 1

serveDiscoveryMethod · 0.92

Calls 1

TokenFunction · 0.85

Tested by

no test coverage detected