MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / generateOrgTokenFilePathFromURL

Function generateOrgTokenFilePathFromURL

token/path.go:37–44  ·  view source on GitHub ↗

generateOrgTokenFilePathFromURL will return a filepath for given Access application token

(authDomain string)

Source from the content-addressed store, hash-verified

35
36// generateOrgTokenFilePathFromURL will return a filepath for given Access application token
37func generateOrgTokenFilePathFromURL(authDomain string) (string, error) {
38 configPath, err := getConfigPath()
39 if err != nil {
40 return "", err
41 }
42 name := strings.Replace(fmt.Sprintf("%s-org-token", authDomain), "/", "-", -1)
43 return filepath.Join(configPath, name), nil
44}
45
46func getConfigPath() (string, error) {
47 configPath, err := homedir.Expand(config.DefaultConfigSearchDirectories()[0])

Callers 2

getTokenFunction · 0.85
GetOrgTokenIfExistsFunction · 0.85

Calls 1

getConfigPathFunction · 0.85

Tested by

no test coverage detected