Skip to content

Simplify the logic for looking up provider and principal key in pg_tde_set_*_key_using_*_key_provider() #274

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 3 commits into from
Apr 28, 2025

Conversation

jeltz
Copy link
Collaborator

@jeltz jeltz commented Apr 26, 2025

The global_status enum was only used in one place and obscured the two dimensions of provider types (database vs global) and principal keys (server vs default vs database).

Also make the current intent of the superuser check clearer by moving it into the internal function and checking for superuser depending on if we try to access a global key provider or not.

jeltz added 3 commits April 26, 2025 10:45
Improve readability for the provider vs key type logic.
This enum was only used in one place and oscured the two dimensions of
provider types (database vs global) and principal keys (server vs
default vs database).
Make the intent a lot cleaner by doing the check when a global provider
us used instead of deciding to do it or not per user facing function.
@jeltz jeltz requested review from dutow and dAdAbird as code owners April 26, 2025 08:56
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.23%. Comparing base (e355f38) to head (80a2331).

❌ Your project status has failed because the head coverage (78.23%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           TDE_REL_17_STABLE     #274      +/-   ##
=====================================================
- Coverage              78.34%   78.23%   -0.11%     
=====================================================
  Files                     22       22              
  Lines                   2484     2472      -12     
  Branches                 391      387       -4     
=====================================================
- Hits                    1946     1934      -12     
  Misses                   462      462              
  Partials                  76       76              
Components Coverage Δ
access 79.35% <ø> (ø)
catalog 86.05% <100.00%> (-0.19%) ⬇️
common 92.50% <ø> (ø)
encryption 71.90% <ø> (ø)
keyring 72.07% <ø> (ø)
src 53.79% <ø> (ø)
smgr 98.01% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz jeltz changed the title Simplify the logic for looking up provider and principal in pg_tde_set_*_key_using_*_key_provider() Simplify the logic for looking up provider and principal key in pg_tde_set_*_key_using_*_key_provider() Apr 26, 2025
@jeltz jeltz merged commit bb000ef into percona:TDE_REL_17_STABLE Apr 28, 2025
15 checks passed
@jeltz jeltz deleted the tde/simplify-global-lookup branch April 28, 2025 08:16
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.

3 participants