NOISSUE - Add Domains to the SDK (#45)

* add: domains sdk

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: error

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cli users token and refresh

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: cli provision

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add domains cli

Signed-off-by: Arvindh <arvindh91@gmail.com>

* remove test program

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update cli command for list domains

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add list user domain cli cmd

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix varaible naming

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: comments grammar & varabile; add package headers

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
This commit is contained in:
Arvindh
2023-11-17 16:12:53 +05:30
committed by GitHub
parent 7acf21a3e1
commit 48dddc4bba
13 changed files with 632 additions and 66 deletions
+2 -6
View File
@@ -142,15 +142,11 @@ func createUser(s sdk.SDK, conf Config) (string, error) {
Status: sdk.EnabledStatus,
}
pass := user.Credentials.Secret
user, err := s.CreateUser(user, "")
if err != nil {
if _, err := s.CreateUser(user, ""); err != nil {
return "", fmt.Errorf("unable to create user: %w", err)
}
user.Credentials.Secret = pass
token, err := s.CreateToken(user)
token, err := s.CreateToken(sdk.Login{Identity: user.Credentials.Identity, Secret: user.Credentials.Secret})
if err != nil {
return "", fmt.Errorf("unable to login user: %w", err)
}
+1 -1
View File
@@ -90,7 +90,7 @@ func Provision(conf Config) error {
var err error
// Login user
token, err := s.CreateToken(user)
token, err := s.CreateToken(sdk.Login{Identity: user.Credentials.Identity, Secret: user.Credentials.Secret})
if err != nil {
return fmt.Errorf("unable to login user: %s", err.Error())
}