Commit fc9c25ba authored by inso's avatar inso

Fix requirements json

parent 200a4d7b
......@@ -138,7 +138,8 @@ REQUIREMENTS_SCHEMA = {
"timestamp": {
"type": "string"
}
}
},
"required": ["timestamp"]
},
"outdistanced": {
"type": "boolean"
......@@ -157,7 +158,8 @@ REQUIREMENTS_SCHEMA = {
"expiresIn": {
"type": "number"
}
}
},
"required": ["from", "to", "expiresIn"]
}
},
"membershipPendingExpiresIn": {
......@@ -165,11 +167,29 @@ REQUIREMENTS_SCHEMA = {
},
"membershipExpiresIn": {
"type": "number"
}
}
},
"wasMember": {
"type": "boolean"
},
"isSentry": {
"type": "boolean"
},
"revoked": {
"type": "boolean"
},
"revokation_sig": {
"type": ["string", "null"]
},
"revoked_on": {
"type": ["number", "null"]
},
},
"required": ["pubkey", "uid", "meta", "outdistanced", "certifications", "membershipPendingExpiresIn",
"membershipExpiresIn", "wasMember", "isSentry", "revoked", "revoked_on", "revocation_sig"]
}
}
}
},
"required": ["identities"]
}
LOOKUP_SCHEMA = {
......@@ -212,7 +232,10 @@ LOOKUP_SCHEMA = {
"type": "string",
},
"revokation_sig": {
"type": "string"
"type": ["string", "null"]
},
"revoked_on": {
"type": ["number", "null"]
},
"revoked": {
"type": "boolean"
......@@ -256,7 +279,10 @@ LOOKUP_SCHEMA = {
"type": "string"
},
"revokation_sig": {
"type": "string"
"type": ["string", "null"]
},
"revoked_on": {
"type": ["number", "null"]
},
"revoked": {
"type": "boolean"
......
......@@ -220,6 +220,12 @@ class Test_BMA_Wot(WebFunctionalSetupMixin, unittest.TestCase):
"timestamp": "1470-46221DE81776D8382F6DE595105386ADEDD291BEC33D238C506F56EA3721B012"
},
"outdistanced": False,
"revocation_sig": None,
"revoked": False,
"revoked_on": None,
"expired": False,
"isSentry": True,
"wasMember": True,
"certifications": [
{
"from": "J78bPUvLjxmjaEkdjxWLeENQtcfXm7iobqB49uT1Bgp3",
......@@ -247,4 +253,5 @@ class Test_BMA_Wot(WebFunctionalSetupMixin, unittest.TestCase):
}
]
}
jsonschema.validate(REQUIREMENTS_SCHEMA, json_sample)
jsonschema.validate(json_sample, REQUIREMENTS_SCHEMA)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment