Skip to content

Commit e2f0b27

Browse files
authored
Merge pull request #32 from ConductorOne/BB906_Delete
[BB-906] baton-sql-server: delete users when we do account deprovisioning.
2 parents b4c84f1 + 656c0f7 commit e2f0b27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/connector/server_user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func (d *userPrincipalSyncer) Delete(ctx context.Context, resourceId *v2.Resourc
249249
return nil, err
250250
}
251251

252-
err = d.client.DisableUserFromServer(ctx, user.Name)
252+
err = d.client.DeleteUserFromServer(ctx, user.Name)
253253
if err != nil {
254254
return nil, err
255255
}

pkg/mssqldb/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ func (c *Client) GetServer(ctx context.Context) (*ServerModel, error) {
3535
return &ret, nil
3636
}
3737

38-
func (c *Client) DisableUserFromServer(ctx context.Context, userName string) error {
38+
func (c *Client) DeleteUserFromServer(ctx context.Context, userName string) error {
3939
if strings.ContainsAny(userName, "[]\"';") {
4040
return fmt.Errorf("invalid characters in userName")
4141
}
4242

4343
query := fmt.Sprintf(`
44-
ALTER LOGIN [%s] DISABLE;`, userName)
44+
DROP LOGIN [%s];`, userName)
4545

4646
_, err := c.db.ExecContext(ctx, query)
4747
if err != nil {

0 commit comments

Comments
 (0)