Repository navigation
fix(auth): Validate tenantId and providerId format - #577
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces robust validation for tenant IDs and provider IDs (OIDC and SAML) across the Firebase Admin SDK, ensuring they are not empty, malformed, or containing unescaped characters. It also adds comprehensive unit tests to verify these validation rules. The feedback suggests a minor readability improvement in both OidcProviderConfigClient and SamlProviderConfigClient to directly compare the provider ID string to its prefix rather than comparing their lengths.
macastelaz
marked this pull request as ready for review
October 19, 2026 15:24
lsirac
suggested changes
Oct 19, 2026
lsirac
approved these changes
Oct 19, 2026
lahirumaramba
approved these changes
Oct 20, 2026
lahirumaramba
left a comment
Member
There was a problem hiding this comment.
LGTM! Thank you.
Adding a blank line after the foreach closing brace should resolve the build failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validates that
tenantIdandproviderIdidentifiers contain only valid URL path characters before constructing Auth REST API requests:TenantManager/TenantAwareFirebaseAuth/FirebaseUserManager/ProviderConfigManager: ValidatestenantIdformat viaTenantManager.ValidateTenantId.ProviderConfigClient/OidcProviderConfigClient/SamlProviderConfigClient: Centralizes and strengthensproviderIdformat validation inProviderConfigClient.ValidateProviderId.tenantIdandproviderIdformats acrossTenantManagerTest,TenantAwareFirebaseAuthTest,OidcProviderConfigTest, andSamlProviderConfigTest.See b/528694160 for more context