Content deleted Content added
m use sentence case for sensitive IPs object heading |
add some examples |
||
Line 94:
* <code>ipv6-ranges</code> - an array of IPv6 CIDR strings that belong to the entity, and are considered as sensitive by Wikipedia. This field is optional, and may not be present.
* <code>notes</code> - notes about the entity or its ranges. This field is optional, and may not be present.
== Examples ==
Here are some examples of some queries from Lua and the results they produce.
=== No matches ===
Query:
<source lang="lua">
querySensitiveIPs{
test = {'1.2.3.4'}
}
</source>
Result:
<source lang="lua">
{
["sensitiveips"] = {
}
}
</source>
=== One match ===
Query:
<source lang="lua">
querySensitiveIPs{
test = {'156.33.5.76'}
}
</source>
Result:
<source lang="lua">
{
["sensitiveips"] = {
["matches"] = {
table#11 {
["entity-id"] = "ussenate",
["ip"] = "156.33.5.76",
["ip-version"] = "IPv4",
["matches-range"] = "156.33.0.0/16",
["type"] = "ip",
},
},
["matched-ranges"] = {
["156.33.0.0/16"] = {
["entity-id"] = "ussenate",
["ip-version"] = "IPv4",
["range"] = "156.33.0.0/16",
},
},
["entities"] = {
["ussenate"] = {
["description"] = "[[United States Senate]]",
["id"] = "ussenate",
["ipv4Ranges"] = {
"156.33.0.0/16",
},
["ipv6Ranges"] = {
"2620:0:8a0::/48",
"2600:803:618::/48",
},
["name"] = "United States Senate",
["reason"] = "political",
},
},
["entity-ids"] = {
"ussenate",
},
},
}
</source>
=== One match, JSON output ===
Query:
Query:
<source lang="lua">
querySensitiveIPs{
format = 'json',
test = {'156.33.5.76'}
}
</source>
Result:
<source lang="json">
{
"sensitiveips":{
"matches":[
{
"matches-range": "156.33.0.0/16",
"ip-version": "IPv4",
"entity-id": "ussenate",
"type": "ip",
"ip": "156.33.5.76"
}
],
"matched-ranges": {
"156.33.0.0/16": {
"ip-version": "IPv4",
"entity-id": "ussenate",
"range": "156.33.0.0/16"
}
},
"entities": {
"ussenate": {
"ipv6Ranges": [
"2620:0:8a0::/48",
"2600:803:618::/48"
],
"name": "United States Senate",
"id": "ussenate",
"ipv4Ranges": [
"156.33.0.0/16"
],
"description": "[[United States Senate]]",
"reason": "political"
}
},
"entity-ids": [
"ussenate"
]
}
}
</source>
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
|