diff --git a/kubernetes.yaml b/kubernetes.yaml index fead383b..e64112d1 100644 --- a/kubernetes.yaml +++ b/kubernetes.yaml @@ -14,14 +14,19 @@ spec: labels: project: verapdf-rest spec: + terminationGracePeriodSeconds: 300 containers: - name : verapdf-rest image: ghcr.io/verapdf/rest:dev + lifecycle: + preStop: + exec: + command: ["/bin/sleep", "300"] resources: requests: cpu: "250m" limits: - cpu: "250m" + cpu: "2000m" ports: - containerPort: 8080 name : rest-api-port diff --git a/src/main/java/org/verapdf/rest/resources/ProfileResource.java b/src/main/java/org/verapdf/rest/resources/ProfileResource.java index 3ff4aae8..a80fe09e 100644 --- a/src/main/java/org/verapdf/rest/resources/ProfileResource.java +++ b/src/main/java/org/verapdf/rest/resources/ProfileResource.java @@ -93,7 +93,7 @@ public static Set getFlavours() { /** * @param profileId * the String id of the Validation profile (1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @return a validation profile selected by id */ @GET @@ -108,7 +108,7 @@ public static Set getFlavours() { )})}) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public static ValidationProfile getProfile(@Parameter(description = "the String id of the Validation profile " + - "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId) { return DIRECTORY.getValidationProfileById(profileId); } @@ -116,7 +116,7 @@ public static ValidationProfile getProfile(@Parameter(description = "the String /** * @param profileId * the String id of the Validation profile (1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @return the {@link java.util.Set} of * {@link org.verapdf.pdfa.validation.profiles.RuleId}s for the selected * Validation Profile @@ -133,7 +133,7 @@ public static ValidationProfile getProfile(@Parameter(description = "the String )})}) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public static Set getProfileRules(@Parameter(description = "the String id of the Validation profile " + - "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId) { SortedSet ids = new TreeSet<>(new Profiles.RuleIdComparator()); for (Rule rule : DIRECTORY.getValidationProfileById(profileId).getRules()) { @@ -145,7 +145,7 @@ public static Set getProfileRules(@Parameter(description = "the String i /** * @param profileId * the String id of the Validation profile (1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param clause * a {@link java.lang.String} identifying the profile clause to * return the Rules for @@ -165,7 +165,7 @@ public static Set getProfileRules(@Parameter(description = "the String i )})}) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public static Set getRulesForClause(@Parameter(description = "the String id of the Validation profile " + - "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "a string identifying the profile clause to return the rules for") @PathParam("clause") String clause) { diff --git a/src/main/java/org/verapdf/rest/resources/ValidateResource.java b/src/main/java/org/verapdf/rest/resources/ValidateResource.java index f324f44c..e076ddfb 100644 --- a/src/main/java/org/verapdf/rest/resources/ValidateResource.java +++ b/src/main/java/org/verapdf/rest/resources/ValidateResource.java @@ -85,7 +85,7 @@ public static ComponentDetails getDetails() { * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param uploadedInputStream * a {@link java.io.InputStream} to the PDF to * be validated @@ -108,7 +108,7 @@ public static ComponentDetails getDetails() { @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML}) public static InputStream validateXml(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(name = "file", schema = @Schema(implementation = File.class), style = ParameterStyle.FORM, description = "an InputStream of the PDF to be validated") @@ -123,7 +123,7 @@ public static InputStream validateXml(@Parameter(description = "the String id of * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param sha1Hex * the hex String representation of the file's * SHA-1 hash @@ -149,7 +149,7 @@ public static InputStream validateXml(@Parameter(description = "the String id of @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML}) public static InputStream validateXml(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "the hex String representation of the file's SHA-1 hash") @FormDataParam("sha1Hex") String sha1Hex, @@ -177,7 +177,7 @@ public static InputStream validateXml(@Parameter(description = "the String id of @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_XML}) public static InputStream validateXml(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "a URL of PDF to be validated") @FormDataParam("url") String urlLink, @@ -190,7 +190,7 @@ public static InputStream validateXml(@Parameter(description = "the String id of * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param uploadedInputStream * a {@link java.io.InputStream} to the PDF to * be validated @@ -203,7 +203,7 @@ public static InputStream validateXml(@Parameter(description = "the String id of @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_JSON}) public static InputStream validateJson(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(name = "file", schema = @Schema(implementation = File.class), style = ParameterStyle.FORM, description = "an InputStream of the PDF to be validated") @@ -218,7 +218,7 @@ public static InputStream validateJson(@Parameter(description = "the String id o * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param sha1Hex * the hex String representation of the file's * SHA-1 hash @@ -234,7 +234,7 @@ public static InputStream validateJson(@Parameter(description = "the String id o @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_JSON}) public static InputStream validateJson(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "the hex String representation of the file's SHA-1 hash") @FormDataParam("sha1Hex") String sha1Hex, @@ -253,7 +253,7 @@ public static InputStream validateJson(@Parameter(description = "the String id o @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.APPLICATION_JSON}) public static InputStream validateJson(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "a URL of PDF to be validated") @FormDataParam("url") String urlLink, @@ -266,7 +266,7 @@ public static InputStream validateJson(@Parameter(description = "the String id o * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param uploadedInputStream * a {@link java.io.InputStream} to the PDF to * be validated @@ -291,7 +291,7 @@ public static InputStream validateHtml(@PathParam("profileId") String profileId, * @param profileId * the String id of the Validation profile * (auto, 1b, 1a, 2b, 2a, 2u, - * 3b, 3a, 3u, 4, 4e, 4f or ua1) + * 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2) * @param sha1Hex * the hex String representation of the file's * SHA-1 hash @@ -322,7 +322,7 @@ public static InputStream validateHtml(@PathParam("profileId") String profileId, @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces({MediaType.TEXT_HTML}) public static InputStream validateHtml(@Parameter(description = "the String id of the Validation profile " + - "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f or ua1)") + "(auto, 1b, 1a, 2b, 2a, 2u, 3b, 3a, 3u, 4, 4e, 4f, ua1 or ua2)") @PathParam("profileId") String profileId, @Parameter(description = "a URL of PDF to be validated") @FormDataParam("url") String urlLink, diff --git a/src/main/resources/org/verapdf/rest/views/restclient.mustache b/src/main/resources/org/verapdf/rest/views/restclient.mustache index 4a36d2e3..19e0c96f 100644 --- a/src/main/resources/org/verapdf/rest/views/restclient.mustache +++ b/src/main/resources/org/verapdf/rest/views/restclient.mustache @@ -93,6 +93,7 @@ +
@@ -151,6 +152,9 @@
  • PDF/UA-1 | ua1
  • +
  • PDF/UA-2 | + ua2 +