test: assert admin metadata GET decrypts on first request#13645
Open
shreemaan-abhishek wants to merge 1 commit into
Open
test: assert admin metadata GET decrypts on first request#13645shreemaan-abhishek wants to merge 1 commit into
shreemaan-abhishek wants to merge 1 commit into
Conversation
Follow-up test coverage for apache#12624. The existing plugin-metadata3.t covered the nil-init state and the 404 crash, but used example-plugin, which has no encrypt_fields, so it never asserted the primary behavior: that the first successful GET of an encrypted metadata field returns plaintext rather than ciphertext. Add a case using azure-functions.master_apikey (a real encrypt_fields metadata) that resets plugin.enable_data_encryption to nil to simulate a fresh worker, then asserts the GET returns the decrypted value while etcd still holds the ciphertext. Also scope local_conf/err as locals in TEST 1 to avoid leaking globals.
This file contains hidden or 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
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.
Description
Follow-up test coverage for #12624.
The existing
t/admin/plugin-metadata3.tcovers theplugin.enable_data_encryptionnil-init state and the 404-GET crash, but it usesexample-plugin, which has noencrypt_fields. So it never asserts the primary behavior the fix restored: that the first successful GET of an encrypted metadata field returns plaintext, not ciphertext.This PR adds a case using
azure-functions.master_apikey(a realencrypt_fieldsmetadata):plugin.enable_data_encryption = nilto simulate a fresh worker where the flag has not been lazily initialized yet.plugin.enable_gde()forces initialization on the GET path.Without #12624 this case returns ciphertext; with it, plaintext.
Also scopes
local_conf/erras locals in TEST 1 (they were previously assigned as globals).Checklist