-
Notifications
You must be signed in to change notification settings - Fork 32
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
Refactor tce #86
Open
ioguix
wants to merge
16
commits into
michelp:main
Choose a base branch
from
ioguix:refactor_tce
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor tce #86
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before this commit, triggers and views were all recreated each time a matching event trigger was exectued. Now, create_mask_view(...) only create or replace the old view on top of a table with some encrypted fields. It doesn't drop/create encryption trigger anymore. The previous code generating encryption triggers has been moved to a new dedicated function called create_mask_colum(...). The event trigger used to call update_masks() which was rebuilding all the view and all the triggers. thanks of the split of create_mask_view() and create_mask_colum(), it can now calls either of these function based on the object type of the event.
This commit creates C trigger functions "trg_encrypt_using_key_col()" and "trg_encrypt_using_key_id()" able to encrypt any column in any table no matter the name or position of the column. That means we now pass to the trigger the column name we need to encrypt and other infos about the encryption key, additional data, nonce, etc. In consequence, we now use the same two functions for all our encryption triggers. This avoids the generation of a dedicated plpgsql trigger for each column we need to encrypt. Creating generic triggers for any table/column is not possible in plpgsql because you can not reference a record's field using a variable. Plpgsql is not able to dereference a column inside the "new" record.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch is based on branch full_ext_script_3.2 (PR #85). It includes: