Fixed JWT tests

This commit is contained in:
Xavi Aracil 2024-04-04 15:14:07 +02:00
parent 7608773cd8
commit d811b940df
6 changed files with 38 additions and 3 deletions

View File

@ -95,6 +95,15 @@ public class OB30Tests {
assertDoesNotThrow(()->{
Report report = validator.run(Samples.OB30.PNG.SIMPLE_JWT_PNG.asFileResource());
if(verbose) PrintHelper.print(report, true);
assertValid(report);
});
}
@Test
void testSimpleV1PNGJWTValid() {
assertDoesNotThrow(()->{
Report report = validator.run(Samples.OB30.PNG.SIMPLE_V1_JWT_PNG.asFileResource());
if(verbose) PrintHelper.print(report, true);
// TODO: moved to warning due to:
// - json schema validation error against canonical schema (json-ld schema validates)
// - outdated context version
@ -117,10 +126,17 @@ public class OB30Tests {
assertDoesNotThrow(()->{
Report report = validator.run(Samples.OB30.SVG.SIMPLE_JWT_SVG.asFileResource());
if(verbose) PrintHelper.print(report, true);
// TODO: moved to warning due to:
assertValid(report);
});
}
@Test
void testSimpleV1JsonSVGJWTValid() {
assertDoesNotThrow(()->{
Report report = validator.run(Samples.OB30.SVG.SIMPLE_V1_JWT_SVG.asFileResource());
if(verbose) PrintHelper.print(report, true);
// - json schema validation error against canonical schema (json-ld schema validates)
// - outdated context version
// assertValid(report);
assertWarning(report);
});
}

View File

@ -7,6 +7,7 @@ public class Samples {
public static final class SVG {
public final static Sample SIMPLE_JSON_SVG = new Sample("ob30/simple-json.svg", true);
public final static Sample SIMPLE_JWT_SVG = new Sample("ob30/simple-jwt.svg", true);
public final static Sample SIMPLE_V1_JWT_SVG = new Sample("ob30/simple-jwt_v1.svg", true);
}
public static final class JSON {
public final static Sample COMPLETE_JSON = new Sample("ob30/complete.json", false);
@ -45,6 +46,7 @@ public class Samples {
public static final class PNG {
public final static Sample SIMPLE_JWT_PNG = new Sample("ob30/simple-jwt.png", true);
public final static Sample SIMPLE_JSON_PNG = new Sample("ob30/simple-json.png", true);
public final static Sample SIMPLE_V1_JWT_PNG = new Sample("ob30/simple-jwt_v1.png", true);
}
public static final class JWT {
public final static Sample SIMPLE_JWT = new Sample("ob30/simple.jwt", true);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:openbadges="https://purl.imsglobal.org/ob/v3p0" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<openbadges:credential verify="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImp3ayI6eyJlIjoiQVFBQiIsImt0eSI6IlJTQSIsIm4iOiI2dGM1dnJnQ2JzbGNrRzdPTTJoWkxJMnNxSHZabTdLS2FPTTItck1WczdyVjBRMEFiZk1ia1pXRzlfTENfM3RaelRld0tiblY1ZXZycFlVVGI4V09TVzk3dXNwZFFFMG5wR1pKdFdFWWgxaFJoM1hEVFBPVFRLa1ZwR2lJQWVocTdIRHJsYmxUZE41TUlqRWpPNnFhWTRhRzlIYXBMeXZHVUY2a2xGb2ctODZOWktOUXR0dVJvZWtlb3ZBdWhxZFhMd0RVZnJuOWlZTEowNmtWQkNKa1ZHdS1RYVlBbUFBcElfTFJGUWV4SF9BNXJQZnhZWEhReHctWmpBaVZNdkhwYmVtYkExWm9HUU5XOW92ZS1ZNWRQSm5CcWlDNEtSTzViMUctQU1KaVdHZDEwSFVkTEFDZ3FHX2FkWGktcmdHUFJINmpGRG9ZQzc2eDROQzBvVG9NS3cifX0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vcHVybC5pbXNnbG9iYWwub3JnL3NwZWMvb2IvdjNwMC9jb250ZXh0Lmpzb24iLCJ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hIjp7Im5hcnJhdGl2ZSI6IlRlYW0gbWVtYmVycyBhcmUgbm9taW5hdGVkIGZvciB0aGlzIGJhZGdlIGJ5IHRoZWlyIHBlZXJzIGFuZCByZWNvZ25pemVkIHVwb24gcmV2aWV3IGJ5IEV4YW1wbGUgQ29ycCBtYW5hZ2VtZW50LiJ9LCJkZXNjcmlwdGlvbiI6IlRoaXMgYmFkZ2UgcmVjb2duaXplcyB0aGUgZGV2ZWxvcG1lbnQgb2YgdGhlIGNhcGFjaXR5IHRvIGNvbGxhYm9yYXRlIHdpdGhpbiBhIGdyb3VwIGVudmlyb25tZW50LiIsIm5hbWUiOiJUZWFtd29yayJ9fSwiaWF0IjoxNzEyMjM2MTYwLCJpc3MiOiJodHRwczovLzFlZHRlY2guZWR1L2lzc3VlcnMvNTY1MDQ5IiwiYXVkIjoiZGlkOmV4YW1wbGU6ZWJmZWIxZjcxMmViYzZmMWMyNzZlMTJlYzIxIiwibmJmIjoxMjYyMzA0MDAwLCJqdGkiOiJodHRwOi8vZXhhbXBsZS5jb20vY3JlZGVudGlhbHMvMzUyNyJ9.cz2WJC2nbP5CeL1g4sBpG_HLUIYVs0SzVZPsM3D_78tHGgWRKP_75XKw2653HK9B7tYoXdy1JYTohQeJOlkQiWAHoWhRGrzPI9Rj97G0s1CqZssT5BdkqOar0Z-F764wkPulqNSrDGRs-P_bxuEXjsUAPITEB9rccuAQks-vGm7ugq6QLNUCPRiosOQnxqXzvznqDDG0evvnDh0P1Y-iKbQKq9XwFo3BnhIGQOtLRDhkac8LeeeOmGngnhjxI5Zf4x280xYT1GvheFaHg4UsFBs85LL8XcOJSxaQPEvrQqSQADgLOSGaDiISmAFITSgaC22gtEadpSO90gqVo4iW2g"></openbadges:credential>
<g>
<path fill="none" stroke="#040000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M500,928.8c0,0,0,40.8,245,40.8" />
<path fill="none" stroke="#040000" stroke-width="1.9215" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M500,928.8c0,0,40.8,0,285.8,0" />

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:openbadges="https://purl.imsglobal.org/ob/v3p0" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<openbadges:credential verify="eyJhbGciOiJSUzI1NiIsImp3ayI6eyJrdHkiOiJSU0EiLCJuIjoiajJ0Si1rWGkySnNhOXJQRW85X1NpOWduWE15TEdYeTVfUDU5TmdFSkMzOER3NjB0N1plVHJuOHJtY1NNT2JxeEo1ay0xMl9CNjBFRENRNWtuLWJtbm44cEdVZ2o3eGttV3pNYmJQcjBEbTlzTVlkLXRoSTlmMjFFSlFmdHd3Y1QydG5fLTZjVVlPTEtFcF9jR3BvcEJmSVhheU1zQ1BDOS1sLVRRZjFicHY1TERZUXk4aDZ0TmNsclVYTHluYVBVWXBfVjBmRDdQdlpHbTZVMmdSbk5HT3c4TWJ5YlJ4SVpXLU9WbjhHQ2lYWDNzYXJQRkxDeENud1JiUWdmRW00M2ZzbFU0S1drR3lOdHA5WnY4V25HejVPQVV5UkZIWk1ZOEF4ZERmOUNYU3MxS2szUDU5YWxYRW5BbmtBQU5DcWhfUlRNdVZiSlYxMmZRTkthcFphSkdRIiwiZSI6IkFRQUIifX0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vcHVybC5pbXNnbG9iYWwub3JnL3NwZWMvb2IvdjNwMC9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JuYW1lIjoiVGVhbXdvcmsifX0sImNyZWRlbnRpYWxTY2hlbWEiOlt7ImlkIjoiaHR0cHM6Ly9wdXJsLmltc2dsb2JhbC5vcmcvc3BlYy9vYi92M3AwL3NjaGVtYS9qc29uL29iX3YzcDBfYW55YWNoaWV2ZW1lbnRjcmVkZW50aWFsX3NjaGVtYS5qc29uIiwidHlwZSI6IjFFZFRlY2hKc29uU2NoZW1hVmFsaWRhdG9yMjAxOSJ9XX0sImlhdCI6MTcxMjIzNTc4OSwiaXNzIjoiaHR0cHM6Ly9leGFtcGxlLmVkdS9pc3N1ZXJzLzU2NTA0OSIsImF1ZCI6ImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2ZjFjMjc2ZTEyZWMyMSIsIm5iZiI6MTI2MjMwNDAwMCwianRpIjoiaHR0cDovL2V4YW1wbGUuZWR1L2NyZWRlbnRpYWxzLzM3MzIifQ.R0yCzAQ4Wcls9TP2i6HeynCfsH9EWu8xqAhttVqN_H0bwfokJkDzeMfnZqd7hTeIqG2tL-9IcMwnk_V-7B4AT3kzAyQMg9pJ91zAxAPWlbsTRCxeUJjD__T744OSjxnDH9CoSNedWuGRi5bryBMqmXi1hcfndR19WuREw87K-6s8bkyNtSTjRhLiQo00It-GH47qHRd-djbtygjlzwkMMdkHhiFjr-Q_kX73_7g7_ttUgWDriYilROqkdLq9wbfOnJFuO16fdVsrCB3g1cT7P6gcaap9NModIwm4qQwAzJN6C94tj29Bag41CnUcKOOCWNNnhc2xmgForOVcKQP6ow"></openbadges:credential>
<g>
<path fill="none" stroke="#040000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M500,928.8c0,0,0,40.8,245,40.8" />
<path fill="none" stroke="#040000" stroke-width="1.9215" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M500,928.8c0,0,40.8,0,285.8,0" />
<path fill="none" stroke="#040000" stroke-width="1.9215" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M214.2,928.8c0,0,40.8,0,285.8,0" />
<path fill="none" stroke="#040000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="M500,928.8c0,0,0,40.8-245,40.8" />
<path d="M581.7,316.2c22.6,0,40.8,18.3,40.8,40.8s-18.3,40.8-40.8,40.8c-22.6,0-40.8-18.3-40.8-40.8S559.1,316.2,581.7,316.2z" />
<circle cx="418.3" cy="357.1" r="40.8" />
<path d="M500,403.6c0,0-34.8,25.3-81.7,38.9c24.2,63.1,81.7,77.9,81.7,77.9s57.5-14.7,81.7-77.9C534.8,429,500,403.6,500,403.6z" />
<path d="M856.6,689.6c0,0-3.3-89,16.6-196.2c39.4,104.7,119.7,164.3,116.8,203.3C930.9,739.3,856.6,689.6,856.6,689.6z" />
<path d="M143.4,689.6c0,0,3.3-89-16.6-196.2C87.5,598.1,7.1,657.7,10.1,696.7C69.1,739.3,143.4,689.6,143.4,689.6z" />
<path d="M835.4,367.4c0-232.1-184.3-337-335.4-337s-335.4,104.8-335.4,337c-3,24.9-42.3,125.5-42.3,151.4c0,269.7,109.3,450.8,377.8,450.8c268.5,0,377.8-181.1,377.8-450.8C877.8,492.9,838.4,392.2,835.4,367.4z M500,856.9c-119.1,0-264.4-56.5-264.4-265c0-100.2,37.8-148.3,37.8-148.3s-72.5-271.8,132.2-271.8c50.9,0,77.3,48.4,94.4,48.4s50.8-48.4,94.4-48.4c204.7,0,132.2,271.8,132.2,271.8s37.8,48.1,37.8,148.3C764.5,800.4,619.1,856.9,500,856.9z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB