You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/03/12 08:31:17 UTC

[PR] Fix ModelEncryptionSupport serialization/deserialization bugs [cxf]

gnodet opened a new pull request, #2953:
URL: https://github.com/apache/cxf/pull/2953

   ## Summary
   
   Fixes two bugs in `ModelEncryptionSupport` that made `DefaultEncryptingOAuthDataProvider` practically unusable:
   
   1. **Null values serialized as spaces**: `tokenizeString(null)` returned `" "` (space), so `new Client("clientId", null, false)` would deserialize with `clientSecret = " "` instead of `null`
   2. **Collections serialized with brackets and spaces**: Using `List.toString()` produced `[openid, email]`, and `parseSimpleList` would strip the brackets but leave spaces, resulting in `" email"` instead of `"email"`
   
   ### Changes
   
   - `tokenizeString`: returns `""` instead of `" "` for null
   - `getStringPart`: checks for `""` instead of `" "` 
   - New `tokenizeCollection`/`tokenizeMap` helpers replace direct `.toString()` calls
   - `parseSimpleList`/`parseSimpleMap`: simplified to work with comma-separated values without brackets
   - All `split()` calls use `-1` limit to preserve trailing empty strings
   - `parseSimpleMap`: added empty check to avoid NPE on empty strings
   - Applied `getStringPart` to client id/secret in `recreateClientInternal`
   
   Supersedes #816. A JIRA ticket should be created for this fix.
   
   ## Test plan
   
   - [x] Added `testPublicClient` test — verifies null secret round-trips correctly
   - [x] All existing `CryptoUtilsTest` tests pass
   - [ ] CI verification
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix ModelEncryptionSupport serialization/deserialization bugs [cxf]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #2953:
URL: https://github.com/apache/cxf/pull/2953#issuecomment-4046020203

   CI failures are unrelated flaky OAuth2 systest failures (AuthorizationGrantTest, PublicClientTest — port/server startup issues). Re-triggering.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org