Skip to content

[Kotlin] Replace deprecated Ktor base64 encoding with Kotlin std library call#23334

Closed
rlnt wants to merge 1 commit intoOpenAPITools:masterfrom
rlnt:ktor-deprecation
Closed

[Kotlin] Replace deprecated Ktor base64 encoding with Kotlin std library call#23334
rlnt wants to merge 1 commit intoOpenAPITools:masterfrom
rlnt:ktor-deprecation

Conversation

@rlnt
Copy link
Copy Markdown
Contributor

@rlnt rlnt commented Mar 24, 2026

This pull request fixes the usage of the Base64 encoding coming from Ktor with a call to the Kotlin standard library. The old method was marked deprecated with Ktor 3.4.0.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) @yutaka0m (2020/03) @stefankoppier (2022/06) @e5l (2024/10) @dennisameling (2026/02)

fixes #22808


Summary by cubic

Replace deprecated Ktor Base64 encoding (io.ktor.util.encodeBase64) with Kotlin stdlib kotlin.io.encoding.Base64.encode in HttpBasicAuth for Ktor JVM and Multiplatform clients. Removes deprecation warnings and ensures compatibility with Ktor 3.4.0 with no behavior change, fixing #22808.

Written for commit 9acac9f. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 24, 2026

please follow step 3 to update the samples so that CI can verify the change

@rlnt
Copy link
Copy Markdown
Contributor Author

rlnt commented Mar 24, 2026

Problem being I am on Windows, and I have no WSL, nor do I plan to install it just for this PR. I leave it as a draft, and if a maintainer wants to finish it, that would be nice. I only submitted the PR because you asked for it in the linked issue to get things started. Sorry for the inconvenience, but installing a Linux kernel just for a PR is not worth it for me personally 😄

@rlnt rlnt marked this pull request as draft March 24, 2026 09:38
@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 24, 2026

don't worry. we will update the samples later

is it correct to say that you've tested this fix locally to confirm it works for your use cases in the production environment?

@rlnt
Copy link
Copy Markdown
Contributor Author

rlnt commented Mar 24, 2026

Yes, I used a template override and regenerated the API client to make sure the deprecation message is gone.

@wing328
Copy link
Copy Markdown
Member

wing328 commented Mar 25, 2026

merged via #23345 (you as co-author) with updated samples

@wing328 wing328 closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[KOTLIN][BUG] Ktor deprecation for authentication

2 participants