Skip to content

fix(auth): validate tenant and provider IDs and URL-encode query parameters - #996

Merged
macastelaz merged 2 commits into
mainfrom
fix-tenant-provider-id-validation
Oct 21, 2026
Merged

macastelaz merged 2 commits into
mainfrom
fix-tenant-provider-id-validation

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Description

  • Validates that tenant_id and provider_id values are valid URL path segments before constructing Auth and Identity Platform management request paths.
  • Uses params dictionary / URL query encoding for list_oidc_provider_configs, list_saml_provider_configs, and project_management app listing requests so query parameters such as pageToken are properly percent-encoded.

Testing

  • Added unit tests in tests/test_tenant_mgt.py, tests/test_auth_providers.py, and tests/test_project_management.py.

@macastelaz
macastelaz requested a review from a team October 20, 2026 16:02

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

Copy link
Copy Markdown

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 enhances security and robustness by validating tenant and provider IDs as safe URL segments and refactoring query parameter construction to use dictionaries, ensuring proper URL encoding. The review feedback suggests further improving consistency in tenant_mgt.py by replacing manual validation checks in update_tenant with the newly introduced _auth_utils.validate_tenant_id helper function.

Comment thread firebase_admin/tenant_mgt.py Outdated

@lahirumaramba lahirumaramba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks!

@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Oct 21, 2026
@macastelaz
macastelaz merged commit ae0a284 into main Oct 21, 2026
24 checks passed
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.

2 participants