Skip to content
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

fix: prevent implicit conversions to/from EncryptedColumn #2668

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

alecthomas
Copy link
Collaborator

Make EncryptedColumn a struct so we can't accidentally implicitly convert []byte to/from it. As a side-effect, discovered a few columns in the DB that weren't the correct types.

@alecthomas alecthomas added the run-all A PR with this label will run the full set of CI jobs in the PR rather than in the merge queue label Sep 13, 2024
@alecthomas alecthomas requested review from a team and worstell and removed request for a team September 13, 2024 05:06
This was referenced Sep 13, 2024
@alecthomas alecthomas force-pushed the aat/no-implicit-encryption-conversion branch from 02ed469 to 0de615e Compare September 13, 2024 05:10
@alecthomas alecthomas requested a review from gak September 13, 2024 05:11
Make EncryptedColumn a struct so we can't accidentally implicitly convert
`[]byte` to/from it. As a side-effect, discovered a few columns in the DB that
weren't the correct types.
@alecthomas alecthomas force-pushed the aat/no-implicit-encryption-conversion branch from 0de615e to 851d3a6 Compare September 13, 2024 05:13
@@ -36,7 +36,8 @@ func TestNewCronJobsForModule(t *testing.T) {
conn := sqltest.OpenForTesting(ctx, t)
dal := dal.New(conn)

encryption, err := encryption.New(ctx, conn, ftlencryption.NewBuilder())
uri := "fake-kms://CK6YwYkBElQKSAowdHlwZS5nb29nbGVhcGlzLmNvbS9nb29nbGUuY3J5cHRvLnRpbmsuQWVzR2NtS2V5EhIaEJy4TIQgfCuwxA3ZZgChp_wYARABGK6YwYkBIAE"
encryption, err := encryption.New(ctx, conn, ftlencryption.NewBuilder().WithKMSURI(optional.Some(uri)))
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@alecthomas alecthomas removed the run-all A PR with this label will run the full set of CI jobs in the PR rather than in the merge queue label Sep 13, 2024
@alecthomas alecthomas added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit 234a35c Sep 13, 2024
89 checks passed
@alecthomas alecthomas deleted the aat/no-implicit-encryption-conversion branch September 13, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants