MCPcopy Create free account
hub / github.com/dropbox/dbxcli / writeTokens

Function writeTokens

cmd/auth.go:214–226  ·  view source on GitHub ↗
(filePath string, tokens TokenMap)

Source from the content-addressed store, hash-verified

212}
213
214func writeTokens(filePath string, tokens TokenMap) error {
215 if _, err := os.Stat(filePath); os.IsNotExist(err) {
216 if err = os.MkdirAll(filepath.Dir(filePath), 0700); err != nil {
217 return err
218 }
219 }
220
221 b, err := json.Marshal(tokens)
222 if err != nil {
223 return err
224 }
225 return os.WriteFile(filePath, b, 0600)
226}
227
228func getAccessCredential(tokType string, domain string, force bool) (storedCredential, string, error) {
229 filePath, err := authFilePath()

Calls

no outgoing calls