Skip to content

Replace Spring Security Base64 with java.util equivalent#3857

Merged
strehle merged 7 commits intocloudfoundry:developfrom
gdgenchev:migrate-base64-utf8
May 6, 2026
Merged

Replace Spring Security Base64 with java.util equivalent#3857
strehle merged 7 commits intocloudfoundry:developfrom
gdgenchev:migrate-base64-utf8

Conversation

@gdgenchev
Copy link
Copy Markdown
Contributor

org.springframework.security.crypto.codec.Base64 was deprecated in Spring Security 6 and later removed in Spring Security 7. Replaced with java.util.Base64.

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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Base64 across several unit/integration tests.
  • Updated Basic Auth header construction to use Base64.getEncoder().encode(...).
  • Updated UserNotFoundEvent to use java.util.Base64 for 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.

Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpointDocs.java Outdated
Comment thread server/src/test/java/org/cloudfoundry/identity/uaa/test/UaaTestAccounts.java Outdated
COPilot additions merged in.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpointDocs.java Outdated
Comment thread server/src/test/java/org/cloudfoundry/identity/uaa/test/UaaTestAccounts.java Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 18 comments.

Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpointDocs.java Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 12 comments.

Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 12 comments.

Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
Comment thread uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/token/TokenMvcMockTests.java Outdated
…headers

Replace new String(Base64.getEncoder().encode(...getBytes())) with
Base64.getEncoder().encodeToString(...getBytes(StandardCharsets.UTF_8))
to avoid platform-default-charset dependency.
@strehle strehle requested a review from Copilot May 6, 2026 15:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@strehle strehle merged commit 306200f into cloudfoundry:develop May 6, 2026
31 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants