8000 fix: add postgres triggers to remove deleted users from user_links by Emyrk · Pull Request #12117 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: add postgres triggers to remove deleted users from user_links #12117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
linting
  • Loading branch information
Emyrk committed Feb 13, 2024
commit f2c90c19dcc38bf05d3f2cb1192e71b7f02cb592
2 changes: 1 addition & 1 deletion coderd/database/dbmem/dbmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -6138,7 +6138,7 @@ func (q *FakeQuerier) RevokeDBCryptKey(_ context.Context, activeKeyDigest string
return sql.ErrNoRows
}

func (q *FakeQuerier) SoftDeleteUserByID(ctx context.Context, id uuid.UUID) error {
func (q *FakeQuerier) SoftDeleteUserByID(_ context.Context, id uuid.UUID) error {
q.mutex.Lock()
defer q.mutex.Unlock()

Expand Down
1 change: 1 addition & 0 deletions coderd/userauth_test.go
4014
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ func TestUserOAuth2Github(t *testing.T) {
require.Empty(t, links)

// Make sure a user_link cannot be created with a deleted user.
// nolint:gocritic // Unit test
_, err = db.InsertUserLink(dbauthz.AsSystemRestricted(ctx), database.InsertUserLinkParams{
UserID: deleted.ID,
LoginType: "github",
Expand Down
0