MCPcopy
hub / github.com/spacecloud-io/space-cloud / GetCredentials

Function GetCredentials

space-cli/cmd/utils/creds.go:78–92  ·  view source on GitHub ↗

GetCredentials get all the stored credentials

()

Source from the content-addressed store, hash-verified

76
77// GetCredentials get all the stored credentials
78func GetCredentials() (*model.Credential, error) {
79 filePath := getAccountConfigPath()
80 yamlFile, err := file.File.ReadFile(filePath)
81 if err != nil {
82 logrus.Errorf("error getting credential unable to read accounts config file - %s", err.Error())
83 return nil, err
84 }
85
86 credential := new(model.Credential)
87 if err := yaml.Unmarshal(yamlFile, credential); err != nil {
88 logrus.Errorf("error getting credential unable to unmarshal accounts config file - %s", err.Error())
89 return nil, err
90 }
91 return credential, nil
92}

Callers 3

getSelectedAccountFunction · 0.85
RemoveAccountFunction · 0.85
ChangeSelectedAccountFunction · 0.85

Calls 4

getAccountConfigPathFunction · 0.85
ReadFileMethod · 0.65
ErrorMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected