Fix EncryptedValue handling in lookup adapter forms (7.0)#25351
Open
danotorrey wants to merge 7 commits into7.0from
Open
Fix EncryptedValue handling in lookup adapter forms (7.0)#25351danotorrey wants to merge 7 commits into7.0from
danotorrey wants to merge 7 commits into7.0from
Conversation
Add `prepareConfig` plugin hook to transform EncryptedValue fields
before they enter Formik state. This prevents the auto-validation
useEffect from sending raw `{"is_set": true}` to the server, which
fails deserialization.
The Formik migration in AdapterFormFields introduced a validation
useEffect that fires before child fieldset effects can convert
encrypted values. Moving the conversion to a synchronous useMemo
in AdapterForm ensures values are transformed before any validation.
The LookupTableResource.updateAdapter() method was saving adapter configs
directly without merging EncryptedValue fields. When the client sent
{"keep_value": true}, the value was lost because the existing encrypted
value was never fetched from the database.
Add prepareConfigUpdate() to LookupDataAdapterConfiguration following the
same pattern as EventNotificationConfig.prepareConfigUpdate(). Override it
in GreyNoiseQuickIPDataAdapter.Config to preserve api_token on update.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
masterto7.0prepareConfigUpdate()useMemowrappersnextUserPassword/prd Graylog2/graylog-plugin-enterprise#13548
Cherry-picked commits
7c44372e5f— Fix EncryptedValue serialization in lookup adapter formscc652ca132— Add changelogf09c500eed— Fix backend: merge EncryptedValue fields on adapter update5674609594— Remove unnecessary useMemo06a86a0074— Add type for nextUserPasswordTest plan
🤖 Generated with Claude Code