Open MSzalowski opened 4 months ago
Still blocked to check on dev-sancho and test-sancho env:
Blocked by: [
OK, TBC - response ok, status ok, for case: URL ok, hash ok, expected: 200, status: None - NOT STATUS FOR CORRECT STATE
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/InfoJune03.jsonld",
"hash": "eebfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"metadata": {
"abstract": "test",
"motivation": "test",
"rationale": "test",
"references": [
"https://test.com/"
],
"title": "test"
},
"valid": true
}
}
--------------------
OK - response ok, status ok, for case: URL ok, corrupted hash aa: expected: INCORRECT_HASH
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/InfoJune03.jsonld",
"hash": "aabfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"metadata": {
"abstract": "test",
"motivation": "test",
"rationale": "test",
"references": [
"https://test.com/"
],
"title": "test"
},
"status": "INVALID_HASH",
"valid": false
}
}
--------------------
OK - response ok, status ok, for case: URL ok, empty hash, expected: INCORRECT_HASH
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/InfoJune03.jsonld",
"hash": ""
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"metadata": {
"abstract": "test",
"motivation": "test",
"rationale": "test",
"references": [
"https://test.com/"
],
"title": "test"
},
"status": "INVALID_HASH",
"valid": false
}
}
--------------------
OK - response ok, status ok, for case: URL to not existing file, hash ok: expected: URL_NOT_FOUND
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/NOT_EXISTS.jsonld",
"hash": "eebfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"status": "URL_NOT_FOUND",
"valid": false
}
}
--------------------
OK - response not ok, status ok, for case: Empty URL, empty hash, expected: response - an error code
Inputs:
{
"url": "",
"hash": ""
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"status": "URL_NOT_FOUND",
"valid": false
}
}
--------------------
Below tracked in issue https://github.com/IntersectMBO/govtool/issues/1150:
NOT OK, TBC - response is 200, status is null but hash is not for provied json, for case: URL to other json (drep format), hash ok - expected: INCORRECT_JSONLD
Inputs:
{
"url": "https://github.com/mpawel79/testrepo/blob/master/PawelDrep.jsonld",
"hash": "eebfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"valid": true
}
}
--------------------
NOT OK - response not ok, status not ok, for case: valid URL to corrupted json, hash ok - expected: INCORRECT_JSONLD
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/test_INVALID_JSON_FORMAT.jsonld",
"hash": "eebfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 200
{
"status": null,
"valid": false,
"raw": {
"valid": true
}
}
--------------------
NOT OK - response ok, status not given - some other error msg, for INCORRECT_HASH not resturned, URL ok, corrupted hash to long: expected: INCORRECT_HASH
Inputs:
{
"url": "https://raw.githubusercontent.com/mpawel79/testrepo/master/InfoJune03.jsonld",
"hash": "CORRUPTED_eebfff0e2213ff0c5331e6d9d99d47a5a825dce7053671b6ed4daae4b4e0df5e"
}
Response code: 400
{
"combinator": "ReqBody'",
"error": "Error in $.hash: mzero"
}
--------------------
Click to add a cell.
OK - no error 500 was returned
TBC - status - for postive case - nothing returned when all is fine
Example response:
Incorrect format - when fields of JSONLD file provided under
url
don't match the CIP-108 standard.Incorrect jsonld - when file is not canonizable by jsonld standard
Incorrect hash - when hash of the file provided under
url
doesn't match providedhash
Url not found - when provided url is not reachable.
If validation passes for all the cases response can be any eg.:
{ "valid": true }
Provide to: GET /proposal/list GET /proposal/get/{proposalId} GET /drep/getVotes/{drepId}