MCPcopy Create free account
hub / github.com/algolia/cli / CheckAuth

Function CheckAuth

pkg/auth/auth_check.go:52–67  ·  view source on GitHub ↗
(cfg config.Config)

Source from the content-addressed store, hash-verified

50}
51
52func CheckAuth(cfg config.Config) error {
53 if cfg.Profile().Name == "" {
54 cfg.Profile().LoadDefault()
55 }
56
57 _, err := cfg.Profile().GetApplicationID()
58 if err != nil {
59 return err
60 }
61 _, err = cfg.Profile().GetAPIKey()
62 if err != nil {
63 return err
64 }
65
66 return nil
67}
68
69// CheckACLs check if the current profile has the right ACLs to execute the command
70func CheckACLs(cmd *cobra.Command, f *cmdutil.Factory) error {

Callers

nothing calls this directly

Calls 4

LoadDefaultMethod · 0.80
GetApplicationIDMethod · 0.80
ProfileMethod · 0.65
GetAPIKeyMethod · 0.65

Tested by

no test coverage detected