Replace Spring Security Base64 with java.util equivalent#3857
Merged
strehle merged 7 commits intocloudfoundry:developfrom May 6, 2026
Merged
Replace Spring Security Base64 with java.util equivalent#3857strehle merged 7 commits intocloudfoundry:developfrom
strehle merged 7 commits intocloudfoundry:developfrom
Conversation
Spring Security 7 removed the Base64 class from the spring-security-crypto.codec package. Replaced with java.util.Base64 in all files that used org.springframework.security.crypto.codec.Base64. Related to Spring Boot 4 migration.
7739960 to
00dbdae
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces deprecated Spring Security org.springframework.security.crypto.codec.Base64 usage with java.util.Base64 to maintain compatibility with Spring Security 6+ and prepare for Spring Security 7.
Changes:
- Swapped Spring Security Base64 imports for
java.util.Base64across several unit/integration tests. - Updated Basic Auth header construction to use
Base64.getEncoder().encode(...). - Updated
UserNotFoundEventto usejava.util.Base64for hashing/encoding the username in audit events.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockZonePathTests.java | Replace Spring Base64 with JDK Base64 in multiple Basic Auth header constructions. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java | Same Base64 replacement for token endpoint tests. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/limited/LimitedModeTokenMockMvcTests.java | Same Base64 replacement in limited-mode check_token test. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpointDocs.java | Same Base64 replacement in REST docs test for autologin. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/ScimGroupEndpointsIntegrationTests.java | Same Base64 replacement in client-credentials token helper. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/NativeApplicationIntegrationTests.java | Same Base64 replacement in Basic auth header for negative test. |
| uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/CheckTokenEndpointIntegrationTests.java | Same Base64 replacement in forbidden check_token test. |
| server/src/test/java/org/cloudfoundry/identity/uaa/test/UaaTestAccounts.java | Same Base64 replacement for shared test helper building Basic auth headers. |
| server/src/main/java/org/cloudfoundry/identity/uaa/authentication/event/UserNotFoundEvent.java | Replace Spring Base64 with JDK Base64 in audit-event name hashing/encoding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
COPilot additions merged in. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…headers Replace new String(Base64.getEncoder().encode(...getBytes())) with Base64.getEncoder().encodeToString(...getBytes(StandardCharsets.UTF_8)) to avoid platform-default-charset dependency.
strehle
approved these changes
May 6, 2026
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.
org.springframework.security.crypto.codec.Base64was deprecated in Spring Security 6 and later removed in Spring Security 7. Replaced withjava.util.Base64.