[SPIKE option C] Flatten Event; additive /edge (INTER-2457) - #225
[SPIKE option C] Flatten Event; additive /edge (INTER-2457)#225JuroUhlar wants to merge 6 commits into
Conversation
INTER-2457 option C. Event stays a single model; EventEdge is additive for POST /edge.
☂️ Code Coverage
Overall Coverage
New Files
Modified Files
|
There was a problem hiding this comment.
Pull request overview
This SPIKE regenerates the SDK from a flattened Event schema (single Event model with optional source) while adding an additive Automation Intelligence /edge endpoint with new request/response models and updated docs/schema.
Changes:
- Added
POST /edgeendpoint (analyze_request_for_automation_intelligence) and new modelsEdgeRequest,EdgeRequestHeadersInner, andEventEdge. - Updated
Eventmodel ordering/fields to accommodate edge-derived data (e.g.,ip_info,bot_info,vpn_methods) while keepingEventas one class. - Updated OpenAPI schema snapshot and generated documentation/README references; adjusted
search_eventsquery parameter ordering.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_fingerprint_api.py | Keeps URL param serialization expectations aligned with updated query param ordering. |
| sync.sh | Switches default schema URL to the flattened Event spec (now points to v4-flat). |
| res/fingerprint-server-api.yaml | Adds /edge path + EdgeRequest/EventEdge schemas; updates docs links and query param ordering. |
| README.pypi.md | Documents the new /edge endpoint and new models. |
| README.md | Documents the new /edge endpoint and new models. |
| fingerprint_server_sdk/models/event.py | Reorders/extends flattened Event fields and serialization for edge-related nested models. |
| fingerprint_server_sdk/models/event_edge.py | Adds EventEdge response model for /edge. |
| fingerprint_server_sdk/models/edge_request.py | Adds EdgeRequest request model for /edge. |
| fingerprint_server_sdk/models/edge_request_headers_inner.py | Adds header-entry model used by EdgeRequest.headers. |
| fingerprint_server_sdk/models/init.py | Exports newly generated models. |
| fingerprint_server_sdk/api/fingerprint_api.py | Adds /edge client method and updates docstrings/query param ordering. |
| fingerprint_server_sdk/init.py | Re-exports newly generated models at package top level. |
| docs/FingerprintApi.md | Documents /edge endpoint; updates get_event and search_events docs. |
| docs/EventEdge.md | Adds documentation for EventEdge. |
| docs/Event.md | Updates flattened Event documentation to reflect edge-vs-device semantics. |
| docs/EdgeRequestHeadersInner.md | Adds documentation for header entry model. |
| docs/EdgeRequest.md | Adds documentation for EdgeRequest. |
| .openapi-generator/FILES | Includes the newly generated files in the generator manifest. |
Suppressed comments (3)
fingerprint_server_sdk/api/fingerprint_api.py:635
EventDeviceis referenced in this docstring, but the SDK does not define anEventDevicemodel. The method returnsEvent.
Get a detailed analysis of an individual event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. Returns `EventDevice` when `source` is `device`, and `EventEdge` when `source` is `edge`.
docs/FingerprintApi.md:212
- This section says
get_eventreturnsEventDevice, but the SDK providesEvent(single model) and does not defineEventDevice.
Returns `EventDevice` when `source` is `device`, and `EventEdge` when `source` is `edge`.
fingerprint_server_sdk/api/fingerprint_api.py:710
EventDeviceis referenced in this docstring, but the SDK does not define anEventDevicemodel. The method returnsEvent.
Get a detailed analysis of an individual event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. Returns `EventDevice` when `source` is `device`, and `EventEdge` when `source` is `edge`.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Create an instance of the API class | ||
| api_instance = fingerprint_server_sdk.FingerprintApi(configuration) | ||
|
|
||
| edge_request: EdgeRequest = fingerprint_server_sdk.EdgeRequest() # |
| ) | ||
| vpn_confidence: Optional[VpnConfidence] = None | ||
| vpn_methods: Optional[VpnMethods] = None | ||
| source: EventSource |
| @validate_call | ||
| def analyze_request_for_automation_intelligence( | ||
| self, | ||
| edge_request: EdgeRequest, | ||
| _request_timeout: Union[ |
| ipv4_address: Optional[StrictStr] = Field( | ||
| default=None, description='Client IPv4 address observed by your server.' | ||
| ) | ||
| ipv6_address: Optional[StrictStr] = Field( | ||
| default=None, description='Client IPv6 address observed by your server.' | ||
| ) | ||
| linked_id: Optional[StrictStr] = Field( | ||
| default=None, description='A customer-provided id that was sent with the request.' | ||
| ) | ||
| tags: Optional[dict[str, Any]] = Field( | ||
| default=None, | ||
| description='A customer-provided value or an object that was sent with the identification request or updated later.', | ||
| ) | ||
| __properties: ClassVar[list[str]] = [ |
| schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4-flat.yaml}" | ||
| examplesBaseUrl="${2:-$defaultBaseUrl/examples}" |
pnpm exec changesetto create a changeset. |
|
@copilot review |
…idation, sync.sh fallback, /edge tests Co-authored-by: JuroUhlar <11249993+JuroUhlar@users.noreply.github.com>
Addressed the remaining unresolved review items in ecf38fc:
Left the |
SPIKE. Do not merge. Option C: Event stays a single model. Generated from openapi#465. Not the earlier all-SDK union spike (#224), which wraps Event in
actual_instance.Eventis still one class:identificationoptional,source: Optional[EventSource].analyze_request_for_automation_intelligence→EventEdge, plusEdgeRequest.sync.shdefaults tofingerprint-server-api-v4-flat.yaml(404 until the OpenAPI package publishes that file).Known: Event field order
Generated field order follows flattened
EventDevice(sourcemoved down). Keyword construction and JSON are unchanged. PositionalEvent("id", 123, ...)would shift; almost all usage is keywords.Huge Event.py diff
Mostly reorder plus
/edgemodels. Getter/field names are the same set as main.