mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-20 02:27:40 +03:00
Add outdated schema functionnality.
Also added shipyard to release.
This commit is contained in:
parent
6bc2c02463
commit
c0d4f4c8b0
@ -100,6 +100,12 @@
|
||||
<td class="invalid_5min stat">-</td>
|
||||
<td class="invalid_60min stat">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Outdated messages</th>
|
||||
<td class="outdated_1min stat">-</td>
|
||||
<td class="outdated_5min stat">-</td>
|
||||
<td class="outdated_60min stat">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Messages passed to relay</th>
|
||||
<td class="outbound_1min stat">-</td>
|
||||
|
@ -451,6 +451,10 @@ var showStats = function(type, currentItem){
|
||||
el.find(".invalid_1min").html((currentItemStats["invalid"] || {})['1min'] || 0);
|
||||
el.find(".invalid_5min").html((currentItemStats["invalid"] || {})['5min'] || 0);
|
||||
el.find(".invalid_60min").html((currentItemStats["invalid"] || {})['60min'] || 0);
|
||||
|
||||
el.find(".outdated_1min").html((currentItemStats["outdated"] || {})['1min'] || 0);
|
||||
el.find(".outdated_5min").html((currentItemStats["outdated"] || {})['5min'] || 0);
|
||||
el.find(".outdated_60min").html((currentItemStats["outdated"] || {})['60min'] || 0);
|
||||
}
|
||||
|
||||
if(type == 'relays')
|
||||
@ -525,8 +529,9 @@ var start = function(){
|
||||
credits: { enabled: false },
|
||||
exporting: { enabled: false },
|
||||
series: [
|
||||
{id: 'inbound', data: [], name: 'Messages received', zIndex: 300},
|
||||
{id: 'invalid', data: [], name: 'Invalid messages', zIndex: 1},
|
||||
{id: 'inbound', data: [], name: 'Messages received', zIndex: 300},
|
||||
{id: 'invalid', data: [], name: 'Invalid messages', zIndex: 1},
|
||||
{id: 'outdated', data: [], name: 'Outdated messages', zIndex: 1},
|
||||
{id: 'outbound', data: [], name: 'Messages passed to relay', zIndex: 200}
|
||||
]
|
||||
}).hide();
|
||||
|
@ -130,6 +130,12 @@ def parse_and_error_handle(data):
|
||||
logger.error("Error to %s: %s" % (get_remote_address(), exc.message))
|
||||
return str(exc)
|
||||
|
||||
# Here we check if an outdated schema has been passed
|
||||
if parsed_message["$schemaRef"] in Settings.GATEWAY_OUTDATED_SCHEMAS.keys():
|
||||
response.status = 426
|
||||
statsCollector.tally("outdated")
|
||||
return "FAIL: The schema you have used need an upgrade. Update your software."
|
||||
|
||||
validationResults = validator.validate(parsed_message)
|
||||
|
||||
if validationResults.severity <= ValidationSeverity.WARN:
|
||||
|
@ -38,11 +38,16 @@ class _Settings(object):
|
||||
GATEWAY_IP_KEY_SALT = None
|
||||
|
||||
GATEWAY_JSON_SCHEMAS = {
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1": "schemas/commodity-v0.1.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/commodity/2": "schemas/commodity-v2.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/2/test": "schemas/commodity-v2.0.json"
|
||||
"http://schemas.elite-markets.net/eddn/commodity/2/test": "schemas/commodity-v2.0.json",
|
||||
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/1": "schemas/shipyard-v1.0.json",
|
||||
"http://schemas.elite-markets.net/eddn/shipyard/1/test": "schemas/shipyard-v1.0.json"
|
||||
}
|
||||
|
||||
GATEWAY_OUTDATED_SCHEMAS = {
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1": "schemas/commodity-v0.1.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json"
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
@ -1,3 +1,3 @@
|
||||
# coding: utf8
|
||||
|
||||
__version__ = "0.4"
|
||||
__version__ = "0.5 BETA"
|
||||
|
Loading…
x
Reference in New Issue
Block a user