Skip to content

feat(pnv): Add Firebase Phone Number Verification support#757

Merged
lahirumaramba merged 24 commits into
devfrom
lm-fpnv
May 13, 2026
Merged

feat(pnv): Add Firebase Phone Number Verification support#757
lahirumaramba merged 24 commits into
devfrom
lm-fpnv

Conversation

@lahirumaramba
Copy link
Copy Markdown
Member

@lahirumaramba lahirumaramba commented Apr 28, 2026

Add support for Firebase Phone Number Verification

boikoa-gl and others added 12 commits March 31, 2026 12:54
…S fetching

- Added ClientWithoutAuth helper to internal.HTTPClient to safely strip the oauth2.Transport layer while retaining custom transport configurations (e.g., proxies).
- Updated phonenumberverification.NewClient to utilize the App's HTTP client options (conf.Opts) when fetching JWKS, resolving the TODO item.
@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Apr 28, 2026
Copy link
Copy Markdown
Contributor

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

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 introduces the Firebase Phone Number Verification (FPNV) service to the Go SDK. Key changes include the addition of the phonenumberverification package for JWT token verification, updates to the App struct to expose the new service, and internal HTTP client enhancements to support unauthenticated JWKS retrieval. Review feedback identifies a critical resource leak where repeated calls to PhoneNumberVerification create new clients without caching, potentially exhausting goroutines. Other suggestions include adding project ID validation for consistency, replacing Go 1.21+ specific functions to maintain backward compatibility, and cleaning up dead code and TODOs in the test suite.

Comment thread firebase.go Outdated
Comment thread firebase.go
Comment thread phonenumberverification/phonenumberverification.go
Comment thread phonenumberverification/phonenumberverification_test.go Outdated
Comment thread phonenumberverification/phonenumberverification_test.go Outdated
@lahirumaramba
Copy link
Copy Markdown
Member Author

@gemini-code-assist review

Copy link
Copy Markdown
Contributor

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

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 introduces the Firebase Phone Number Verification (FPNV) service to the Go SDK, adding a new phonenumberverification package, updating the App struct with thread-safe client initialization, and including comprehensive tests. Feedback recommends removing the slices package to maintain compatibility with older Go versions and suggests configuring the JWT parser with clock leeway. Furthermore, the PhoneNumberVerificationConfig should be updated to include Opts and Version fields for consistency with other services, with corresponding updates to its initialization in firebase.go.

Comment thread phonenumberverification/phonenumberverification.go
Comment thread phonenumberverification/phonenumberverification.go
Comment thread phonenumberverification/phonenumberverification.go
Comment thread internal/internal.go
Comment thread firebase.go
Copy link
Copy Markdown
Collaborator

@jonathanedey jonathanedey left a comment

Choose a reason for hiding this comment

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

LGTM with one nit, Thanks!

Comment thread phonenumberverification/phonenumberverification_test.go
Comment thread phonenumberverification/phonenumberverification.go Outdated
Comment thread phonenumberverification/phonenumberverification.go Outdated
Comment thread phonenumberverification/phonenumberverification.go Outdated
Comment thread phonenumberverification/phonenumberverification.go Outdated
Comment thread phonenumberverification/phonenumberverification.go Outdated
Comment thread phonenumberverification/phonenumberverification.go Outdated
lahirumaramba and others added 4 commits May 13, 2026 09:39
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
lahirumaramba and others added 5 commits May 13, 2026 12:25
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
Co-authored-by: Kevin Cheung <kevinthecheung@users.noreply.github.com>
@lahirumaramba lahirumaramba merged commit 646489a into dev May 13, 2026
14 of 15 checks passed
@lahirumaramba lahirumaramba deleted the lm-fpnv branch May 13, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants