-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: remove dependency on pgsodium #37
base: main
Are you sure you want to change the base?
Conversation
696992d
to
f61cd0a
Compare
ac58861
to
f525592
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a separate version here as an alternative to 0.2.8 -> 0.3.0
. This lets the extension be created without first creating pgsodium
, which would be necessary when creating 0.2.8
.
@@ -0,0 +1 @@ | |||
requires = pgsodium |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only 0.2.8
(the current latest version) requires pgsodium
- future versions won't require it.
a8db719
to
72cde61
Compare
@@ -188,3 +190,52 @@ | |||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
|
|||
# pgsodium License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary if the dep is getting pulled out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we use pgsodium code in pgsodium.c and pgsodium.h; we can do away with them once we move from libsodium (still needed to decrypt existing secrets)
sql/supabase_vault--0.3.0.sql
Outdated
GRANT ALL ON SCHEMA vault TO pgsodium_keyiduser; | ||
GRANT ALL ON TABLE vault.secrets TO pgsodium_keyiduser; | ||
GRANT ALL ON vault.decrypted_secrets TO pgsodium_keyiduser; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these roles come from pg_sodium. for new installs on 0.3.0 is pg_sodium still required?
there is no exception in tests currently due to fixtures.sql creating these roles but wouldn't that need to be directly in this setup script for prod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The roles will stay when pgsodium is dropped (Postgres doesn't track extension dependents for roles).
I'll see if I can change how the permissions is set up so we can further remove pgsodium-isms, but at worst we just create these roles at AMI creation once we stop creating pgsodium by default.
nix/postgresql/generic.nix
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soedirgo if it would help once I have a pg 17 in https://github.com/supabase/postgres I could set up a flake here that would let you isolate and use it, so that you could end up with 1:1 sync with what is built and used downstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would help you match exact build + avoid having to maintain your own build of postgres in this project too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...it could also then use the cached versions we have, and would save time on local machine and CI too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that'd be fantastic 👍 it'd halve the size of this PR
c85dca9
to
19571b1
Compare
19571b1
to
e4aab63
Compare
Add a new version 0.3.0 that doesn't depend on pgsodium. All the needed pgsodium functionalities are baked directly into supabase_vault.
Tested flows:
drop extension supabase_vault cascade;
select * from vault.decrypted_secrets
select * from vault.decrypted_secrets
drop extension pgsodium
select * from vault.decrypted_secrets
select * from vault.decrypted_secrets