Repository navigation
fix(parameters): handle invalid UTF-8 transform errors - #8609
Golden007-prog wants to merge 2 commits into
Conversation
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
Merge upstream develop while retaining the invalid UTF-8 transform error policy and raw-byte identity behavior. Preserve the adjacent upstream AppConfig environment/application regression. Signed-off-by: Oikantik Basu <140976895+Golden007-prog@users.noreply.github.com>
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @Golden007-prog, this is exactly the fix I had in mind when I opened the issue. I ran it against real Secrets Manager with invalid and valid binary secrets across every transform, and the error policy now holds everywhere: TransformParameterError when asked to raise, None in a batch when not, and raw bytes when auto finds no suffix to act on.
One thing I want to be explicit about: with transform="auto" and no matching suffix, a valid UTF-8 binary secret used to come back as str and now comes back as bytes, same as transform=None. I think that's the right behavior, the old str was a side effect of decoding too early, but I'll call it out in the release notes.
I'm approving now. This goes out in 3.39.0, so it will sit here for a while before I merge it. No rebase needed in the meantime, and you'll be credited in the release notes.



Issue number: closes #8600
Summary
Changes
Resolve the transform from the parameter name before decoding bytes. Identity transforms preserve the original byte value; UTF-8 decoding for JSON/base64 transforms runs inside the existing error handler. This wraps decoding failures in
TransformParameterError, or returnsNonewhen transformation errors are suppressed.User experience
An invalid UTF-8
SecretBinarynow follows the documented transformation-error policy. Withtransform="auto"and an unmatched suffix, both valid and invalid UTF-8 binary secrets remain bytes instead of being decoded or raising an unexpected exception.Validation
git diff --checkpasses.The full
make prpipeline, live AWS tests, and Valkey native extra were not run. The Valkey extra could not build in this Windows environment. Implementation and verification assisted by OpenAI Codex.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.