INTER-2505: Reject dot parameters for event and visitor IDs - #231
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 /v4/events/..` into a request for `/v4/`, reaching an endpoint the caller never asked for. `get_event`, `update_event`, and `delete_visitor_data` now raise the new `InvalidPathParameterError` before sending, exposing the rejected `parameter` and `value`. It subclasses `ApiValueError`. Related-Task: INTER-2505
Contributor
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The validation, generated templates, public exports, documentation, and request-level tests consistently implement the intended protection.
Review effort: Balanced
Findings: None
What changed in this PR
Rejects unsafe dot-segment identifiers before requests are sent.
Changes:
- Adds and exports
InvalidParameterError. - Validates encoded path parameters and documents invalid values.
- Adds end-to-end request-target coverage for all affected operations.
| File | Description |
|---|---|
test/test_path_params.py |
Tests encoding and dot rejection. |
template/exports_package.mustache |
Exports the new exception. |
template/exceptions.mustache |
Defines the generated exception. |
template/api_doc.mustache |
Generates path-parameter warnings. |
template/api_client.mustache |
Generates dot-segment validation. |
template/__init__package.mustache |
Adds the public export. |
fingerprint_server_sdk/exceptions.py |
Defines InvalidParameterError. |
fingerprint_server_sdk/api_client.py |
Rejects dot path segments. |
fingerprint_server_sdk/__init__.py |
Exposes the exception publicly. |
docs/FingerprintApi.md |
Documents affected operations. |
.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:29
TheUnderScorer
previously approved these changes
Sep 22, 2026
Contributor
🚀 Following releases will be created using changesets from this PR:@fingerprint/python-sdk@9.7.2Patch 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 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 an event 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/v4/events/..%2Fevents. But.and..survive that encoding.event_id..GET /v4/.GET /v4/events/So
get_event('..')silently returns data from an endpoint that was never requested.Changes
InvalidArgumentError(w/ the rejectedparameterandvalue). It subclassesApiValueError.param_serializeraises it before sending when an ID is exactly.or...docs/FingerprintApi.md.Tests assert against the literal request target a local HTTP server receives, not a URL built.