Skip to content

fix(auth): preserve serialization compatibility in JwtCredentials - #15190

Open
lqiu96 wants to merge 1 commit into
googleapis:mainfrom
lqiu96:fix/auth-jwt-credentials-serialization
Open

lqiu96 wants to merge 1 commit into
googleapis:mainfrom
lqiu96:fix/auth-jwt-credentials-serialization

Conversation

@lqiu96

@lqiu96 lqiu96 commented Nov 24, 2026

Copy link
Copy Markdown
Member

No description provided.

@lqiu96
lqiu96 requested a review from whowes November 24, 2026 04:02
@lqiu96
lqiu96 requested review from a team as code owners November 24, 2026 04:02

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds backward compatibility support for deserializing older versions of JwtCredentials that lack the universeDomain field. It introduces a serialVersionUID, customizes readObject to handle null or blank universeDomain values, and adds corresponding unit tests. The review feedback suggests maintaining the immutability and thread-safety of JwtCredentials by keeping universeDomain as a private final field and handling the default value dynamically in getters, equals(), and hashCode(). Additionally, it recommends testing deserialization using a pre-serialized stream from an older version rather than mutating the field directly in tests.

This branch has not been deployed

No deployments
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.

2 participants