MCPcopy Create free account
hub / github.com/auth0/auth0-cli / GetAccessToken

Function GetAccessToken

internal/keyring/keyring.go:87–104  ·  view source on GitHub ↗
(tenant string)

Source from the content-addressed store, hash-verified

85}
86
87func GetAccessToken(tenant string) (string, error) {
88 var accessToken string
89
90 for i := 0; i < secretAccessTokenMaxChunks; i++ {
91 a, err := keyring.Get(fmt.Sprintf("%s %d", secretAccessToken, i), tenant)
92 // Only return if we have pulled more than 1 item from the keyring, otherwise this will be
93 // a valid "secret not found in keyring".
94 if err == keyring.ErrNotFound && i > 0 {
95 return accessToken, nil
96 }
97 if err != nil {
98 return "", err
99 }
100 accessToken += a
101 }
102
103 return accessToken, nil
104}
105
106func chunk(slice string, chunkSize int) []string {
107 var chunks []string

Callers 2

GetAccessTokenMethod · 0.92
TestSecretsFunction · 0.85

Calls 1

GetMethod · 0.80

Tested by 1

TestSecretsFunction · 0.68