Skip to content

test: role privileges on vault objects and indexes #1544

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 1 commit into from
Apr 14, 2025
Merged

Conversation

steve-chavez
Copy link
Member

@steve-chavez steve-chavez commented Apr 14, 2025

Improves the previous tests while reducing britleness and revealing more implicit privileges.

  • Reveals privileges on the _crypto_aead_det_* functions.
  • Avoids testing the signature of functions (which was done by function calls), which is already done on z_15_ext_interface.out.
  supabase_vault         | vault                    | create_secret                                    | new_secret text, new_name text, new_description text, new_key_id uuid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | uuid
  supabase_vault         | vault                    | update_secret                                    | secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | void

(https://github.com/supabase/postgres/blob/9bdefbcb7cc00b0692562c889b6c7d625120bd66/nix/tests/expected/z_15_ext_interface.out#L4754-L4755)

  • Unique index test is added while also revealing the index owner.
  • Avoids testing error messages, which can change across versions.
  • Avoids testing implementation details, and reduces verboseness.

Improves the previous tests while reducing britleness
and revealing more implicit privileges.

- Reveals privileges on the `_crypto_aead_det_*` functions.
- Avoids testing the signature of functions, which is already done on z_15_ext_interface.out.
(https://github.com/supabase/postgres/blob/9bdefbcb7cc00b0692562c889b6c7d625120bd66/nix/tests/expected/z_15_ext_interface.out#L4754-L4755)
- Unique index test is maintained while also revealing the index owner.
- Avoids testing error messages, which can change across versions.
- Avoids testing implementation details, and reduces verboseness.
@steve-chavez steve-chavez marked this pull request as ready for review April 14, 2025 16:40
@steve-chavez steve-chavez requested review from a team as code owners April 14, 2025 16:40
@steve-chavez steve-chavez merged commit 61ff753 into develop Apr 14, 2025
14 checks passed
@steve-chavez steve-chavez deleted the vault-tests branch April 14, 2025 19:22
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.

2 participants