Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Request Revamp #1938

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

feat!: Request Revamp #1938

wants to merge 11 commits into from

Conversation

d-goog
Copy link
Collaborator

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

Description

This is a large refactor of the auth library's internals with sweeping improvements in UX, correctness, performance, security, and scalability.

Examples:

  • UX: Adopts fetch API conventions
  • Correctness: Allows users to add charset to content-types and removes responseType parameter from Gaxios requests
  • Performance: There is far less object-copying when things can be safely reused, especially for Headers

Testing

All existing tests pass and enhanced numerous throughout the codebase.

Impact

This revamp brings number of improvements to library:

  • It returns users predictable, consistent Headers, while allowing the open, flexible HeadersInit for requests.
  • Bumps our dependencies to the Node 18+ versions
  • Simplifies requests:
    • With native support for the RequestInit body types, users can omit certain headers, such as content-type
  • Improves cross-platform compatibility through JS standards adoption (Request, Headers, URLSearchParams, etc.)/

Additional Information

While a large PR, most of the changes are internal and doesn't affect external API consumption much outside from Headers consistency and Node 18's Headers are not case-insensitive when compared in tests (which required a lot of lower-casing header names)

A follow-up PR will add fetch support.

🦕

@d-goog d-goog requested review from a team as code owners February 12, 2025 10:22
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Feb 12, 2025
@d-goog d-goog mentioned this pull request Feb 12, 2025
4 tasks
test/test.googleauth.ts Fixed Show fixed Hide fixed
test/test.googleauth.ts Fixed Show fixed Hide fixed
test/test.idtokenclient.ts Fixed Show fixed Hide fixed
test/test.idtokenclient.ts Fixed Show fixed Hide fixed
Copy link

Warning: This pull request is touching the following templated files:

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Feb 12, 2025
test/test.googleauth.ts Dismissed Show dismissed Hide dismissed
test/test.googleauth.ts Dismissed Show dismissed Hide dismissed
test/test.idtokenclient.ts Dismissed Show dismissed Hide dismissed
test/test.idtokenclient.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
test/test.oauth2.ts Dismissed Show dismissed Hide dismissed
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: xl Pull request size is extra large. labels Feb 12, 2025
@d-goog d-goog changed the title refactor!: Request Revamp feat!: Request Revamp Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant