michelp / pgsodium

Modern cryptography for PostgreSQL using libsodium.
Other
546 stars 32 forks source link

fix TCE trigger update regression and tests to cover it. #49

Closed michelp closed 1 year ago

ioguix commented 1 year ago

Hi,

TCE triggers and generated masking views are still blurry to me as I hadn't time to investigate this part of the code yet.

Like, I'm still not sure what pgsodium_masks is supposed to be. Is it a forgotten artifact from an old version?

Also, unless I'm wrong, SECURITY LABEL FOR pgsodium ON {ROLE|TABLE} are not documented... So I'm still not sure how things are supposed to work around them.

I'm not even sure what this PR is supposed to fix :)

michelp commented 1 year ago

Hi,

TCE triggers and generated masking views are still blurry to me as I hadn't time to investigate this part of the code yet.

Like, I'm still not sure what pgsodium_masks is supposed to be. Is it a forgotten artifact from an old version?

It is, I'll push a fix to remove it, just hasn't been a priority.

Also, unless I'm wrong, SECURITY LABEL FOR pgsodium ON {ROLE|TABLE} are not documented... So I'm still not sure how things are supposed to work around them.

TCE is an optional feature that is still in progress that should be launched in a couple of weeks, there is some documentation that is progress that is not yet complete, so you can skip reviewing future changes until after release:

Here are the docs in progress:

https://github.com/michelp/pgsodium/blob/main/docs/Transparent_Column_Encryption.md

I'm not even sure what this PR is supposed to fix :)

The only non-test change was adding OR UPDATE to the trigger:

https://github.com/michelp/pgsodium/commit/b6ede194df1071c434f0a3fce8c9257e59da05cc#diff-8bce69e00501ddc80327de0ce32914dd249662d8eabc43b67c2487218c8995d5R124

ioguix commented 1 year ago

TCE is an optional feature that is still in progress that should be launched in a couple of weeks, there is some documentation that is progress that is not yet complete,

Oh, ok. I didn't realized TCE wasn't released yet. I was actually wondering why the 3.0 version hadn't been announced yet.

Here are the docs in progress:

https://github.com/michelp/pgsodium/blob/main/docs/Transparent_Column_Encryption.md

Thanks for the feedback and pointer