Skip to content

feat(coderd): add dbcrypt package#9522

Merged
johnstcn merged 12 commits into
mainfrom
cj/dbcrypt_redux_1
Sep 6, 2023
Merged

feat(coderd): add dbcrypt package#9522
johnstcn merged 12 commits into
mainfrom
cj/dbcrypt_redux_1

Conversation

@johnstcn
Copy link
Copy Markdown
Member

@johnstcn johnstcn commented Sep 4, 2023

Reimplementation of #9421 following comments.

  • Adds package enterprise/dbcrypt to implement database encryption/decryption
  • Adds table dbcrypt_keys and associated queries
  • Adds columns oauth_access_token_key_id and oauth_refresh_token_key_id to tables git_auth_links and user_links

NOTE: This is part 1 of a 2-part PR. This PR focuses mainly on the dbcrypt and database packages. A separate PR will add the required plumbing to integrate this into enterprise/coderd properly.

Part 2: #9523

- Adds package enterprise/dbcrypt to implement database encryption/decryption
- Adds table dbcrypt_keys and associated queries
- Adds columns oauth_access_token_key_id and oauth_refresh_token_key_id
  to tables git_auth_links and user_links

NOTE: This is part 1 of a 2-part PR. This PR focuses
mainly on the dbcrypt and database packages. A separate
PR will add the required plumbing to integrate this into
enterprise/coderd properly.

Co-authored-by: Kyle Carberry <kyle@coder.com>
Copy link
Copy Markdown
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the code, and it looks fine to me. I believe that you can proceed with a follow-up.

Comment thread enterprise/dbcrypt/doc.go
Comment thread coderd/database/queries/user_links.sql
Comment thread coderd/database/queries/gitauth.sql Outdated
Comment thread coderd/database/queries/gitauth.sql Outdated
Comment thread coderd/database/queries/gitauth.sql Outdated
Comment thread coderd/database/queries/dbcrypt.sql
Comment thread enterprise/dbcrypt/dbcrypt.go
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
Comment thread enterprise/dbcrypt/dbcrypt.go
@johnstcn johnstcn marked this pull request as ready for review September 5, 2023 09:11
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
Comment thread enterprise/dbcrypt/dbcrypt.go
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
Comment thread coderd/database/dbfake/dbfake.go Outdated
Comment thread enterprise/dbcrypt/dbcrypt.go
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
Comment thread enterprise/dbcrypt/dbcrypt.go Outdated
@johnstcn johnstcn merged commit 7918e65 into main Sep 6, 2023
@johnstcn johnstcn deleted the cj/dbcrypt_redux_1 branch September 6, 2023 11:06
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants