feat: IPv6 end-to-end, OpenAPI 1.4.0 nested schema, frontend dual-stack - #19
Merged
jjesse merged 3 commits intoAug 1, 2026
Conversation
Copilot
AI
changed the title
[WIP] Complete end-to-end IPv6 and schema implementation
feat: IPv6 end-to-end, OpenAPI 1.4.0 nested schema, frontend dual-stack
Aug 1, 2026
jjesse
approved these changes
Aug 1, 2026
There was a problem hiding this comment.
Pull request overview
This PR completes end-to-end IPv6 support and aligns the API contract + frontend with the backend’s nested datacenter response shape, including OpenAPI 1.4.0 updates and supporting docs/tests.
Changes:
- Wire IPv6 through lookup + geolocation filtering and update frontend validation/mapping for dual-stack responses.
- Update
openapi.yamlto v1.4.0 with nestedDatacenterInfoandTraceResult.results[]shape (plus ZDX userpath response shape). - Expand unit tests for IPv6 parsing/range checks and refresh docs/changelog to reflect the new schema and IPv6 support.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| server.js | Dual-stack lookup/geolocation updates; stricter query-param type guarding. |
| openapi.yaml | Bump to 1.4.0 and document nested datacenter + trace results schema updates. |
| public/app.js | Dual-stack IP validation, nested datacenter rendering, and trace results[] normalization. |
| tests/unit/ip.test.js | Add IPv6-focused unit coverage for parsing, validation, and range checks. |
| README.md | Document IPv6 support and updated /api/lookup nested response example; add TRUST_PROXY. |
| README_PYTHON.md | Document OneAPI variant usage and environment variables. |
| CHANGELOG.md | Record IPv6 + OpenAPI 1.4.0 + frontend/schema fixes in Unreleased. |
| TODO.md | Mark IPv6/schema/docs items as completed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
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.
Completes the remaining IPv6 + schema + frontend + docs work on the
feature/openapi-ipv6-private-ipbranch.utils/ip.jsalready had full dual-stack support; this wires it through the rest of the stack.server.js
lookupIp(): Replaced blanketif (cidr.includes(':')) continuewith a family-aware skip — IPv6 CIDRs now match IPv6 queries; IPv4 CIDRs match IPv4 queries:getIpGeolocation(): Expanded private-IP block to cover::1, IPv4 link-local (169.254.x.x), and IPv6 unique-local/link-local (fc00::/7,fe80::/10)/api/lookuproute: Added explicittypeofstring guard on query params — prevents CodeQL type-confusion alert and rejects repeated param arrays@paramupdated from "IPv4" to "IPv4 or IPv6" throughoutopenapi.yaml (v1.4.0)
format: ipv4fromip/sourceIpparamsLookupFoundnow references newDatacenterInfoschema (name,city,country,latitude,longitude,ipRanges[]);LookupNotFoundreturnsdatacenter: null, matchedRange: nullTraceResultusesresults[]withtotalResults/foundResults; hops carry nesteddatacenterobject/api/zdx/userpath200 response updated to match actual{ success, data: { user, device, application, probe, timestamp, hops[] } }shapepublic/app.js
validateIp: dual-stack — IPv4 octet-range check + IPv6 structural check (rejects multiple::)showSuccess: readsdata.datacenter.name/city,data.continent,data.matchedRangefrom nested shapehandleTraceSubmit: normalisesdata.results→ hops display shape when server returns new schema[0-9a-fA-F.:]instead of digits-and-dots onlytests/unit/ip.test.js
ipv6ToBigInt,isValidIpv4,isValidIpv6,getIpFamilyto importsisValidIptest that expectedfalsefor IPv6 (now correctly expectstrue)ipv6ToBigInt,isValidIpv4,isValidIpv6,getIpFamily,parseCidr IPv6(2001:db8::/32,2605:4300:e800::/40),isIpInRange IPv6Docs
/api/lookupresponse example updated to nested datacenter shape;TRUST_PROXYadded to env var table; troubleshooting says "IPv4 or IPv6"zdx_oneapi_geopath.pyOneAPI env vars and usageLookupFoundschema,TRUST_PROXYdocs,requirements.txt, OneAPI docs, private-IP prefix list, bareexceptOriginal prompt