Skip to content

feat: reland vault w/o pgsodium #1452

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 10 commits into from
Mar 19, 2025
Merged

Conversation

soedirgo
Copy link
Member

@soedirgo soedirgo commented Feb 19, 2025

Reland #1431; the migration has been merged in #1442

Tested flows on local infra:

  1. pause & restore w/o vault
    • create a new project
    • drop extension supabase_vault cascade;
    • pause project
    • restore project
    • select * from vault.decrypted_secrets
  2. pause & restore w/ existing secrets
    • create a new project
    • create a new secret in Settings > Vault
    • pause project
    • restore project
    • select * from vault.decrypted_secrets
  3. pause & restore w/ existing secrets w/o pgsodium
    • follow steps in 2
    • drop extension pgsodium
    • pause project
    • restore project
    • select * from vault.decrypted_secrets
  4. pg_upgrade
    • create a new project on an earlier AMI version (e.g. 15.8.1.044)
    • create a new secret in Settings > Vault
    • upgrade project in Settings > Infrastructure
    • select * from vault.decrypted_secrets

@soedirgo soedirgo force-pushed the feat/reland-vault-wo-pgsodium branch 7 times, most recently from 849d90c to 073e79b Compare February 25, 2025 17:29
@soedirgo soedirgo force-pushed the feat/reland-vault-wo-pgsodium branch from 073e79b to 193941e Compare February 25, 2025 17:31
@soedirgo soedirgo marked this pull request as ready for review February 26, 2025 14:01
@soedirgo soedirgo requested a review from a team as a code owner February 26, 2025 14:01
@barrownicholas barrownicholas mentioned this pull request Mar 6, 2025
3 tasks
@barrownicholas
Copy link

Just wanted to check the status of this; we need vault 0.3.1 since it fixes a bug where secrets cannot be empty. Any updates?

@soedirgo
Copy link
Member Author

soedirgo commented Mar 7, 2025

Hey @barrownicholas, this should be available on new & upgraded projects in a few weeks

REENCRYPT_VAULT_SECRETS_QUERY=$(cat <<EOF
DO \$\$
BEGIN
IF EXISTS (SELECT FROM pg_available_extension_versions WHERE name = 'supabase_vault' AND version = '0.3.0')
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be 0.3.0?? The PR is bumping it from 0.2.9 to 0.3.1, where does 0.3.0 come in from?

Also it feels like this patch would need to be executed even if in the future we were on e.g. 0.3.2, and we're likely going to forget to do so?

Copy link
Member Author

@soedirgo soedirgo Mar 18, 2025

Choose a reason for hiding this comment

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

Yep, the query runs for all versions >= 0.3.0. Vault >=0.3.1 would still have 0.3.0 in pg_available_extension_versions

@soedirgo soedirgo merged commit 01978ef into develop Mar 19, 2025
4 of 8 checks passed
@soedirgo soedirgo deleted the feat/reland-vault-wo-pgsodium branch March 19, 2025 08:45
@samrose
Copy link
Collaborator

samrose commented Mar 19, 2025

@doublethink @staaldraad can you please have a look at this to make sure you don't see any known security issues with these changes, and thanks!

damonrand pushed a commit to cepro/postgres that referenced this pull request Jun 15, 2025
* Reapply "feat: vault sans pgsodium"

This reverts commit 447f449.

* chore: update schema snapshots

* chore: print regress diffs for easier debugging

* chore: remove pgsodium priv checks

* fix: move it out of if else

* chore: bump version

* chore: bump version
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.

4 participants