We could be passing along a 0 in these data points which would be considered falsy even though that's a valid value that's coming back. (formattedData) in ipInfo/widget.js needs to consider 0 as valid.
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | kostajh | T285977 IP Info | |||
| Resolved | kostajh | T268657 Epic: IP Info popup | |||
| Resolved | • wikitrent | T286662 Display block and contribs info in popup and infobox [S] | |||
| Resolved | • wikitrent | T293639 Ensure the number 0 is a valid value for formattedData |
Event Timeline
Being bold and assigning Trent since @phuedx said y'all were going to take care of it as part of your current patch
@STran I've verified that inputting 0 as a value seems to trigger the appropriate messages/data. Was there anything else I need to do on this ticket specifically?
I am not sure what we are wanting to test here. I am guessing we want to see how IPInfo handles various types of data.
I set up an intercepting proxy (OWASP ZAP) so I could modify the response the browser is getting from the IPInfo API.
Here are some examples (all tested on beta):
Zeros:
{
"info": [
{
"subject": "<removed>",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": {
"latitude": 39.4439,
"longitude": -104.8515
},
"asn": 0,
"organization": 0,
"location": [
{
"id": 0,
"label": 0
},
{
"id": 0,
"label": 0
}
],
"isp": 0,
"connectionType": 0,
"proxyType": {
"isAnonymous": 0,
"isAnonymousVpn": 0,
"isPublicProxy": 0,
"isResidentialProxy": 0,
"isLegitimateProxy": 0,
"isTorExitNode": 0
}
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": 0
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": 0,
"numRecentEdits": 0
}
]
}
]
}{
"info": [
{
"subject": "<removed>",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": 0,
"asn": 0,
"organization": 0,
"location": 0,
"isp": 0,
"connectionType": 0,
"proxyType": 0
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": 0
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": 0,
"numRecentEdits": 0
}
]
}
]
}Nulls:
{
"info": [
{
"subject": "<removed>",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": {
"latitude": null,
"longitude": null
},
"asn": null,
"organization": null,
"location": [
{
"id": null,
"label": null
},
{
"id": null,
"label": null
}
],
"isp": null,
"connectionType": null,
"proxyType": {
"isAnonymous": null,
"isAnonymousVpn": null,
"isPublicProxy": null,
"isResidentialProxy": null,
"isLegitimateProxy": null,
"isTorExitNode": null
}
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": null
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": null,
"numRecentEdits": null
}
]
}
]
}{
"info": [
{
"subject": "<removed>",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": null,
"asn": null,
"organization": null,
"location": null,
"isp": null,
"connectionType": null,
"proxyType": null
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": null
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": null,
"numRecentEdits": null
}
]
}
]
}Falses:
{
"info": [
{
"subject": "127.0.0.1",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": false,
"asn": false,
"organization": false,
"location": [],
"isp": false,
"connectionType": false,
"proxyType": false
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": false
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": false,
"numRecentEdits": false
}
]
}
]
}{
"info": [
{
"subject": "<removed>",
"data": [
{
"source": "ipinfo-source-geoip2",
"coordinates": {
"latitude": false,
"longitude": false
},
"asn": false,
"organization": false,
"location": [
{
"id": false,
"label": false
},
{
"id": false,
"label": false
}
],
"isp": false,
"connectionType": false,
"proxyType": {
"isAnonymous": false,
"isAnonymousVpn": false,
"isPublicProxy": false,
"isResidentialProxy": false,
"isLegitimateProxy": false,
"isTorExitNode": false
}
},
{
"source": "ipinfo-source-block",
"numActiveBlocks": false
},
{
"source": "ipinfo-source-contributions",
"numLocalEdits": false,
"numRecentEdits": false
}
]
}
]
}This is obviously only testing the client-side of IPInfo.
To test the server-side, I am currently searching through the Max Mind databases for example IPs which return different datatypes, but this will take a while as there is a lot of data.
@wikitrent What do you think?
@dom_walden That's more thorough than anything I thought of, so as long as it's still working that's great on the client side. I'm not sure of another way to test the server side other than what you've suggested.
For the server-side part of this, I used a script to try to find IPs in MaxMind which return different combinations of datatypes for the different data points (ISP, ASN, etc.)
I then checked what response we were getting from the IPInfo API for each of those IPs (using this script).
The way the API handled different types of data seemed reasonable to me and matched the results I was getting from MaxMind using my own script.
I also checked the IPInfo popup for each of those IP addresses. Again, null data appeared to be handled the way I expect.
I don't think I can publish the raw data publicly because it contains personal or licensed data, but I will make it available to the AHT team privately.
Test Environment: local docker IP Info 0.0.0 (6509358) 08:33, 1 November 2021.








