MCPcopy
hub / github.com/gotify/server / GenerateNotExistingToken

Function GenerateNotExistingToken

auth/token.go:28–35  ·  view source on GitHub ↗

GenerateNotExistingToken receives a token generation func and a func to check whether the token exists, returns a unique token.

(generateToken func() string, tokenExists func(token string) bool)

Source from the content-addressed store, hash-verified

26
27// GenerateNotExistingToken receives a token generation func and a func to check whether the token exists, returns a unique token.
28func GenerateNotExistingToken(generateToken func() string, tokenExists func(token string) bool) string {
29 for {
30 token := generateToken()
31 if !tokenExists(token) {
32 return token
33 }
34 }
35}
36
37// GenerateApplicationToken generates an application token.
38func GenerateApplicationToken() string {

Callers 5

createPluginConfMethod · 0.92
CreateApplicationMethod · 0.92
CreateClientMethod · 0.92

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…