credential_darwin.go 559 B

12345678910111213141516171819202122232425
  1. //go:build darwin
  2. package ocm
  3. func platformReadCredentials(customPath string) (*oauthCredentials, error) {
  4. if customPath == "" {
  5. var err error
  6. customPath, err = getDefaultCredentialsPath()
  7. if err != nil {
  8. return nil, err
  9. }
  10. }
  11. return readCredentialsFromFile(customPath)
  12. }
  13. func platformWriteCredentials(credentials *oauthCredentials, customPath string) error {
  14. if customPath == "" {
  15. var err error
  16. customPath, err = getDefaultCredentialsPath()
  17. if err != nil {
  18. return err
  19. }
  20. }
  21. return writeCredentialsToFile(credentials, customPath)
  22. }