Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

feat: Normalize GoogleAuth<T> from JSONClient to AuthClient#1940

Merged
sofisl merged 8 commits intomainfrom
normalize-googleauth-authclient
Jun 12, 2025
Merged

feat: Normalize GoogleAuth<T> from JSONClient to AuthClient#1940
sofisl merged 8 commits intomainfrom
normalize-googleauth-authclient

Conversation

@d-goog
Copy link
Contributor

@d-goog d-goog commented Feb 21, 2025

Description

Improve a long-open pain-point for customers by setting the default AuthClient generic in GoogleAuth to AuthClient:

This improves the default compatibly between GoogleAuth instances as they would all be compatible by default (given AuthClient is the base type of all AuthClients)

Impact

A few things:

  • Improved ergonomics for sharing instances of GoogleAuth
  • Provides a type hints for clientOptions, making it easier for customers to see options for all auth clients:
    • Screenshot 2025-02-20 at 9 54 08 PM

Testing

This is mostly a TypeScript-level change; non-functional. However, I've added a simple test to ensure compatibility.

Additional Information

The clientOptions field could be improved by the following:

Fixes #1677

🦕

@d-goog d-goog requested a review from a team February 21, 2025 05:56
@d-goog d-goog requested a review from a team as a code owner February 21, 2025 05:56
@product-auto-label product-auto-label bot added size: s Pull request size is small. size: m Pull request size is medium. and removed size: s Pull request size is small. labels Feb 21, 2025
@d-goog d-goog changed the title feat!: Normalize to GoogleAuth<AuthClient> feat!: Normalize GoogleAuth<T> from JSONClient to AuthClient Feb 21, 2025
Copy link
Contributor

@sofisl sofisl left a comment

Choose a reason for hiding this comment

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

Since it's breaking, should this wait until Node 20? We can close this PR and create a next major bug for it.

@d-goog
Copy link
Contributor Author

d-goog commented Jun 4, 2025

Since it's breaking, should this wait until Node 20? We can close this PR and create a next major bug for it.

I think we should include it in this major since we added it before the cutoff and it resolves a long-open pain-point for customers.

@sofisl
Copy link
Contributor

sofisl commented Jun 4, 2025

If you can confirm it will be a no-op for already released packages (gapics, handwrittens, and apiary), then I'm ok with it. Otherwise since we've already released these as majors I don't think it'll be wise to add another breaking change.

@sofisl
Copy link
Contributor

sofisl commented Jun 12, 2025

I checked this does not create a breaking change with downstream libraries.

@sofisl sofisl changed the title feat!: Normalize GoogleAuth<T> from JSONClient to AuthClient feat: Normalize GoogleAuth<T> from JSONClient to AuthClient Jun 12, 2025
@sofisl sofisl merged commit 440de51 into main Jun 12, 2025
17 checks passed
@sofisl sofisl deleted the normalize-googleauth-authclient branch June 12, 2025 07:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat!: Normalize GoogleAuth<T> to AuthClient

2 participants