Skip to content

Commit c4559aa

Browse files
authored
feat: Add user provisioning without email confirmation (#87)
* feat: Add user provisioning without email confirmation * style: Format files
1 parent 72c6723 commit c4559aa

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sysdig/internal/client/common/users.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (client *sysdigCommonClient) GetUserByEmail(ctx context.Context, email stri
6060
}
6161

6262
func (client *sysdigCommonClient) CreateUser(ctx context.Context, uRequest *User) (u *User, err error) {
63-
response, err := client.doSysdigCommonRequest(ctx, http.MethodPost, client.GetUsersUrl(), uRequest.ToJSON())
63+
response, err := client.doSysdigCommonRequest(ctx, http.MethodPost, client.CreateUsersUrl(), uRequest.ToJSON())
6464

6565
if err != nil {
6666
return
@@ -126,6 +126,10 @@ func (client *sysdigCommonClient) GetCurrentUser(ctx context.Context) (u *User,
126126
return &user, nil
127127
}
128128

129+
func (client *sysdigCommonClient) CreateUsersUrl() string {
130+
return fmt.Sprintf("%s/api/user/provisioning/", client.URL)
131+
}
132+
129133
func (client *sysdigCommonClient) GetUsersUrl() string {
130134
return fmt.Sprintf("%s/api/users", client.URL)
131135
}

sysdig/resource_sysdig_user_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ func TestAccUser(t *testing.T) {
3030
},
3131
Steps: []resource.TestStep{
3232
{
33-
Config: userWithName(rText()),
33+
Config: userWithSystemRole(rText()),
3434
},
3535
{
36-
Config: userWithSystemRole(rText()),
36+
Config: userWithName(rText()),
3737
},
3838
{
3939
Config: userWithoutSystemRole(rText()),

0 commit comments

Comments
 (0)