INTER-2511: [api-v3] Reject doth parameters for request and visitor IDs - #232
Merged
Merged
Conversation
`.` and `..` survive percent-encoding as literal dots, so urllib3 normalizes them out of the path before the request leaves. Passing `..` as an ID turned `GET /events/..` into a request for `/`, reaching an endpoint the caller never asked for. `get_event`, `update_event`, `get_visits`, and `delete_visitor_data` now raise the new `InvalidPathParameterError` before sending, exposing the rejected `parameter` and `value`. It subclasses `ValueError`. Related-Task: INTER-2511
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation consistently updates generated sources and templates, with comprehensive request-target tests covering all affected operations.
Review effort: Balanced
Findings: None
What changed in this PR
Rejects dot-segment request and visitor IDs before HTTP dispatch, preventing URL normalization from targeting unintended endpoints.
Changes:
- Adds and exports
InvalidParameterError. - Validates encoded path parameters against
.and... - Adds endpoint documentation, tests, and release notes.
| File | Description |
|---|---|
test/test_path_params.py |
Tests encoding and dot-segment rejection using a local server. |
template/rest.mustache |
Generates the new exception. |
template/api_doc.mustache |
Generates path-parameter warnings. |
template/api_client.mustache |
Generates path validation. |
template/__init__package.mustache |
Generates the public exception export. |
fingerprint_pro_server_api_sdk/rest.py |
Defines InvalidParameterError. |
fingerprint_pro_server_api_sdk/api_client.py |
Rejects dot segments before dispatch. |
fingerprint_pro_server_api_sdk/__init__.py |
Exports the exception publicly. |
docs/FingerprintApi.md |
Documents invalid identifiers per operation. |
.changeset/reject-dot-segment-path-parameters.md |
Records the patch-level change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
erayaydin
marked this pull request as ready for review
September 22, 2026 12:31
TheUnderScorer
previously approved these changes
Sep 22, 2026
Contributor
🚀 Following releases will be created using changesets from this PR:fingerprint-pro-server-api-python-sdk@8.15.1Patch Changes
|
erayaydin
marked this pull request as draft
September 22, 2026 15:58
erayaydin
marked this pull request as ready for review
September 23, 2026 11:30
TheUnderScorer
approved these changes
Sep 28, 2026
This branch was successfully deployed
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.
Problem
Passing
.or..as a request or visitor ID reaches a different endpoint than the caller asked for.Values are already encoded into a single segment, so
get_event('../events')correctly requests/events/..%2Fevents. But.and..survive that encoding.request_id..GET /.GET /events/So
get_event('..')silently returns data from an endpoint that was never requested.Changes
InvalidArgumentError(w/ the rejectedparameterandvalue). It subclassesValueError.__call_apiraises it before sending when an ID is exactly.or.., coveringget_event,update_event,get_visits, anddelete_visitor_data.docs/FingerprintApi.md.Tests assert against the literal request target a local HTTP server receives, not a URL built.