Skip to content

fix(auth): validate tenant ID and provider ID URL path segments - #794

Merged
macastelaz merged 3 commits into
devfrom
fix-tenant-provider-id-validation
Oct 21, 2026
Merged

macastelaz merged 3 commits into
devfrom
fix-tenant-provider-id-validation

Conversation

@macastelaz

Copy link
Copy Markdown
Contributor

Description

Validates that tenantID and providerID values are valid URL path segments before constructing Auth and Identity Platform management request paths.

Testing

  • Added unit tests in auth/tenant_mgt_test.go and auth/provider_config_test.go covering invalid tenantID and providerID inputs.

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

Copy link
Copy Markdown
Contributor

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 stricter validation for OIDC, SAML, and tenant IDs by checking them against a safe URL segment pattern via a new isSafeURLSegment helper function. It also adds comprehensive unit tests to verify these validation rules. The review feedback points out redundant checks in validateOIDCConfigID and validateSAMLConfigID (specifically checking for id == "oidc." and id == "saml."), as isSafeURLSegment already rejects strings ending with a dot.

Comment thread auth/provider_config.go Outdated
Comment thread auth/provider_config.go Outdated
@lahirumaramba

Copy link
Copy Markdown
Member

Could you please change the base branch from master to dev? We merge all PRs into dev in the Go SDK

@lahirumaramba lahirumaramba added release-note release:stage Stage a release candidate labels Oct 21, 2026
@macastelaz
macastelaz changed the base branch from master to dev October 21, 2026 15:00
@macastelaz
macastelaz requested a review from a team October 21, 2026 15:00
@macastelaz

Copy link
Copy Markdown
Contributor Author

Changed the base branch to dev. Sorry about that!

@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!

@macastelaz
macastelaz merged commit b7add76 into dev Oct 21, 2026
10 checks passed
@macastelaz
macastelaz deleted the fix-tenant-provider-id-validation branch October 22, 2026 21:05
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