MCPcopy Create free account
hub / github.com/boringproxy/boringproxy / GetTokens

Method GetTokens

api.go:513–526  ·  view source on GitHub ↗
(tokenData TokenData, params url.Values)

Source from the content-addressed store, hash-verified

511}
512
513func (a *Api) GetTokens(tokenData TokenData, params url.Values) map[string]TokenData {
514
515 tokens := a.db.GetTokens()
516
517 user, _ := a.db.GetUser(tokenData.Owner)
518
519 for key, tok := range tokens {
520 if !user.IsAdmin && tok.Owner != tokenData.Owner {
521 delete(tokens, key)
522 }
523 }
524
525 return tokens
526}
527
528func (a *Api) GetUsers(tokenData TokenData, params url.Values) map[string]User {
529

Callers 3

handleTokensMethod · 0.95
DeleteUserMethod · 0.45
handleTokensMethod · 0.45

Calls 1

GetUserMethod · 0.80

Tested by

no test coverage detected