From edda6959cba7e9cb0cf144da6062657b305c543b Mon Sep 17 00:00:00 2001 From: Thibault Vallin Date: Mon, 16 Oct 2023 20:29:03 +0200 Subject: [PATCH] Fix archetypes module (#7803) Signed-off-by: tvallin --- .../src/main/archetype/common/extra.xml | 6 +- .../common/files/application.abac.yaml | 56 +++++++++---------- .../common/files/application.jwt.yaml | 29 +++++----- .../src/main/java/module-info.java.mustache | 10 +++- .../files/src/main/resources/signing-jwk.json | 0 .../src/main/resources/verifying-jwk.json | 0 .../src/main/archetype/common/media.xml | 20 +++++-- .../main/archetype/common/observability.xml | 8 +-- .../src/main/archetype/common/security.xml | 45 +++++++-------- .../main/archetype/mp/custom/custom-mp.xml | 3 +- .../src/main/archetype/mp/custom/database.xml | 2 +- .../archetype/mp/custom/observability.xml | 2 +- .../archetype/mp/database/database-mp.xml | 2 +- .../archetype/mp/quickstart/quickstart-mp.xml | 2 +- .../main/archetype/se/common/common-se.xml | 2 +- .../main/archetype/se/custom/custom-se.xml | 2 +- .../src/main/archetype/se/custom/database.xml | 2 +- .../src/main/archetype/se/custom/extra.xml | 2 +- .../archetype/se/custom/observability.xml | 8 ++- .../src/main/archetype/se/custom/security.xml | 2 - .../archetype/se/quickstart/quickstart-se.xml | 2 +- .../oidc/src/main/java/module-info.java | 2 + 22 files changed, 113 insertions(+), 94 deletions(-) rename archetypes/helidon/src/main/archetype/{se/custom => common}/files/src/main/resources/signing-jwk.json (100%) rename archetypes/helidon/src/main/archetype/{se/custom => common}/files/src/main/resources/verifying-jwk.json (100%) diff --git a/archetypes/helidon/src/main/archetype/common/extra.xml b/archetypes/helidon/src/main/archetype/common/extra.xml index e751286bddc..4df6b01a6fd 100644 --- a/archetypes/helidon/src/main/archetype/common/extra.xml +++ b/archetypes/helidon/src/main/archetype/common/extra.xml @@ -38,7 +38,7 @@ helidon-webclient - + io.helidon.webclient @@ -102,7 +102,7 @@ java -cp "target/classes:target/libs/*" {{package}}.WebClientMain PORT helidon-microprofile-metrics - + io.helidon.microprofile.faulttolerance @@ -151,7 +151,7 @@ java -cp "target/classes:target/libs/*" {{package}}.WebClientMain PORT jakarta.ws.rs.core.Response jakarta.ws.rs.HttpMethod - + io.helidon.microprofile.cors io.helidon.webserver.cors io.helidon.cors diff --git a/archetypes/helidon/src/main/archetype/common/files/application.abac.yaml b/archetypes/helidon/src/main/archetype/common/files/application.abac.yaml index 44fb88d552b..107239d8b8b 100644 --- a/archetypes/helidon/src/main/archetype/common/files/application.abac.yaml +++ b/archetypes/helidon/src/main/archetype/common/files/application.abac.yaml @@ -1,31 +1,31 @@ - - abac: - # prepares environment - # executes attribute validations - # validates that attributes were processed - # grants/denies access to resource - # - #### - # Combinations: - # # Will fail if any attribute is not validated and if any has failed validation - # fail-on-unvalidated: true - # fail-if-none-validated: true - # - # # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation - # # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed) - # fail-on-unvalidated: false - # fail-if-none-validated: true - # - # # Will fail if there is any attribute that failed validation - # # Will NOT fail if there are no failed validation or if there are NONE validated - # fail-on-unvalidated: false - # fail-if-none-validated: false - #### - # fail if an attribute was not validated (e.g. we do not know, whether it is valid or not) - # defaults to true - fail-on-unvalidated: true - # fail if none of the attributes were validated - # defaults to true - fail-if-none-validated: true + - abac: + # prepares environment + # executes attribute validations + # validates that attributes were processed + # grants/denies access to resource + # + #### + # Combinations: + # # Will fail if any attribute is not validated and if any has failed validation + # fail-on-unvalidated: true + # fail-if-none-validated: true + # + # # Will fail if there is one or more attributes present and NONE of them is validated or if any has failed validation + # # Will NOT fail if there is at least one validated attribute and any number of not validated attributes (and NONE failed) + # fail-on-unvalidated: false + # fail-if-none-validated: true + # + # # Will fail if there is any attribute that failed validation + # # Will NOT fail if there are no failed validation or if there are NONE validated + # fail-on-unvalidated: false + # fail-if-none-validated: false + #### + # fail if an attribute was not validated (e.g. we do not know, whether it is valid or not) + # defaults to true + fail-on-unvalidated: true + # fail if none of the attributes were validated + # defaults to true + fail-if-none-validated: true # policy-validator: # validators: # - class: "io.helidon.security.abac.policy.DefaultPolicyValidator" diff --git a/archetypes/helidon/src/main/archetype/common/files/application.jwt.yaml b/archetypes/helidon/src/main/archetype/common/files/application.jwt.yaml index 46f5250f022..bbf364cb0a0 100644 --- a/archetypes/helidon/src/main/archetype/common/files/application.jwt.yaml +++ b/archetypes/helidon/src/main/archetype/common/files/application.jwt.yaml @@ -1,14 +1,15 @@ - - atn-token: - jwk.resource.resource-path: "verifying-jwk.json" - jwt-audience: "http://my.service" - - sign-token: - jwk.resource.resource-path: "signing-jwk.json" - jwt-issuer: "http://my.server/identity" - outbound: - - name: "propagate-token" - hosts: ["*.internal.org"] - - name: "generate-token" - hosts: ["1.partner-service"] - jwk-kid: "partner-1" - jwt-kid: "helidon" - jwt-audience: "http://1.partner-service" + - jwt: + atn-token: + jwk.resource.resource-path: "verifying-jwk.json" + jwt-audience: "http://my.service" + sign-token: + jwk.resource.resource-path: "signing-jwk.json" + jwt-issuer: "http://my.server/identity" + outbound: + - name: "propagate-token" + hosts: ["*.internal.org"] + - name: "generate-token" + hosts: ["1.partner-service"] + jwk-kid: "partner-1" + jwt-kid: "helidon" + jwt-audience: "http://1.partner-service" diff --git a/archetypes/helidon/src/main/archetype/common/files/src/main/java/module-info.java.mustache b/archetypes/helidon/src/main/archetype/common/files/src/main/java/module-info.java.mustache index 90323eb4445..3b0a8490f84 100644 --- a/archetypes/helidon/src/main/archetype/common/files/src/main/java/module-info.java.mustache +++ b/archetypes/helidon/src/main/archetype/common/files/src/main/java/module-info.java.mustache @@ -1,6 +1,12 @@ module {{package}} { -{{#modules}} +{{#module-requires}} requires {{.}}; -{{/modules}} +{{/module-requires}} + + exports {{package}}; + +{{#module-opens}} + opens {{package}}; +{{/module-opens}} } \ No newline at end of file diff --git a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/resources/signing-jwk.json b/archetypes/helidon/src/main/archetype/common/files/src/main/resources/signing-jwk.json similarity index 100% rename from archetypes/helidon/src/main/archetype/se/custom/files/src/main/resources/signing-jwk.json rename to archetypes/helidon/src/main/archetype/common/files/src/main/resources/signing-jwk.json diff --git a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/resources/verifying-jwk.json b/archetypes/helidon/src/main/archetype/common/files/src/main/resources/verifying-jwk.json similarity index 100% rename from archetypes/helidon/src/main/archetype/se/custom/files/src/main/resources/verifying-jwk.json rename to archetypes/helidon/src/main/archetype/common/files/src/main/resources/verifying-jwk.json diff --git a/archetypes/helidon/src/main/archetype/common/media.xml b/archetypes/helidon/src/main/archetype/common/media.xml index 781b501fed4..8cfa3364ac8 100644 --- a/archetypes/helidon/src/main/archetype/common/media.xml +++ b/archetypes/helidon/src/main/archetype/common/media.xml @@ -61,7 +61,7 @@ } ]]> - + jakarta.json @@ -84,9 +84,15 @@ jersey-media-json-jackson runtime + + jakarta.xml.bind + jakarta.xml.bind-api + - + com.fasterxml.jackson.annotation + com.fasterxml.jackson.core + jakarta.xml.bind @@ -128,8 +134,9 @@ } ]]> - + jakarta.json + jakarta.json.bind @@ -162,12 +169,12 @@ jakarta.json-api - + jakarta.json io.helidon.http.media.multipart io.helidon.webserver.staticcontent - + jakarta.json jersey.media.multipart @@ -199,6 +206,9 @@ } ]]> + + org.jvnet.mimepull + diff --git a/archetypes/helidon/src/main/archetype/common/observability.xml b/archetypes/helidon/src/main/archetype/common/observability.xml index 3ddf8568176..9a7ca0daf2c 100644 --- a/archetypes/helidon/src/main/archetype/common/observability.xml +++ b/archetypes/helidon/src/main/archetype/common/observability.xml @@ -142,7 +142,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics @Inject private MetricRegistry registry;]]> - + io.helidon.microprofile.metrics @@ -238,7 +238,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics static org.junit.jupiter.api.Assertions.assertEquals - + io.helidon.microprofile.metrics @@ -276,7 +276,7 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics } ]]> - + io.helidon.webserver.observe.metrics io.helidon.metrics.api @@ -421,7 +421,7 @@ curl -X GET http://localhost:8080/observe/observe/health/ready ]]> - + io.helidon.webserver.observe.health io.helidon.health.checks diff --git a/archetypes/helidon/src/main/archetype/common/security.xml b/archetypes/helidon/src/main/archetype/common/security.xml index 6078348c7d8..91c9263ea18 100644 --- a/archetypes/helidon/src/main/archetype/common/security.xml +++ b/archetypes/helidon/src/main/archetype/common/security.xml @@ -81,10 +81,6 @@ io.helidon.security.providers helidon-security-providers-idcs-mapper - - io.helidon.config - helidon-config-encryption - java.util.Optional @@ -125,10 +121,10 @@ }) .get("/loggedout", (req, res) -> res.send("You have been logged out"))]]> - + io.helidon.security.providers.oidc - + io.helidon.security @@ -136,9 +132,16 @@ - + jakarta.xml.bind diff --git a/archetypes/helidon/src/main/archetype/mp/custom/observability.xml b/archetypes/helidon/src/main/archetype/mp/custom/observability.xml index 963b063870d..af0bb7d539f 100644 --- a/archetypes/helidon/src/main/archetype/mp/custom/observability.xml +++ b/archetypes/helidon/src/main/archetype/mp/custom/observability.xml @@ -28,7 +28,7 @@ - tracing.service=helidon-service + tracing.service=helidon-tracing-service tracing.components.web-server.spans.0.name="HTTP Request" diff --git a/archetypes/helidon/src/main/archetype/mp/database/database-mp.xml b/archetypes/helidon/src/main/archetype/mp/database/database-mp.xml index f8c576f1814..02390694411 100644 --- a/archetypes/helidon/src/main/archetype/mp/database/database-mp.xml +++ b/archetypes/helidon/src/main/archetype/mp/database/database-mp.xml @@ -32,7 +32,7 @@ - + jakarta.annotation jakarta.persistence jakarta.transaction diff --git a/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml b/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml index 0ccf1f7b2cf..5999287c19e 100644 --- a/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml +++ b/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml @@ -96,7 +96,7 @@ helidon-microprofile-openapi - + io.helidon.microprofile.openapi diff --git a/archetypes/helidon/src/main/archetype/se/common/common-se.xml b/archetypes/helidon/src/main/archetype/se/common/common-se.xml index eced4411590..28d77dafd5d 100644 --- a/archetypes/helidon/src/main/archetype/se/common/common-se.xml +++ b/archetypes/helidon/src/main/archetype/se/common/common-se.xml @@ -74,7 +74,7 @@ io.helidon.config.Config - + io.helidon.webserver io.helidon.http io.helidon.config diff --git a/archetypes/helidon/src/main/archetype/se/custom/custom-se.xml b/archetypes/helidon/src/main/archetype/se/custom/custom-se.xml index 076f59625f7..320344d2f98 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/custom-se.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/custom-se.xml @@ -68,7 +68,7 @@ curl -X GET http://localhost:8080/simple-greet ``` ]]> - + io.helidon.logging.common diff --git a/archetypes/helidon/src/main/archetype/se/custom/database.xml b/archetypes/helidon/src/main/archetype/se/custom/database.xml index 0d40f101888..87ea5a5d2a2 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/database.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/database.xml @@ -374,7 +374,7 @@ docker run --rm --name mongo -p 27017:27017 mongo - + io.helidon.dbclient io.helidon.tracing io.helidon.webserver.observe.tracing diff --git a/archetypes/helidon/src/main/archetype/se/custom/extra.xml b/archetypes/helidon/src/main/archetype/se/custom/extra.xml index 06f544725e9..2d70312d83d 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/extra.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/extra.xml @@ -187,7 +187,7 @@ } ]]> - + io.helidon.faulttolerance diff --git a/archetypes/helidon/src/main/archetype/se/custom/observability.xml b/archetypes/helidon/src/main/archetype/se/custom/observability.xml index 79b430f30c7..f5c383b5997 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/observability.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/observability.xml @@ -37,6 +37,12 @@ .addFeature(observe) + + + io.helidon.webserver.observe @@ -111,7 +117,7 @@ } ]]> - + io.helidon.webserver.observe io.helidon.webserver.http2 io.helidon.webserver.observe.tracing diff --git a/archetypes/helidon/src/main/archetype/se/custom/security.xml b/archetypes/helidon/src/main/archetype/se/custom/security.xml index ebaf32b3601..7bccd44854a 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/security.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/security.xml @@ -40,8 +40,6 @@ src/*/resources/**/backend-service-jwt.yaml src/*/resources/**/client-service-jwt.yaml - src/*/resources/**/signing-jwk.json - src/*/resources/**/verifying-jwk.json src/*/resources/**/google.js/google-app.js /**/trick-to-avoid-empty-tag diff --git a/archetypes/helidon/src/main/archetype/se/quickstart/quickstart-se.xml b/archetypes/helidon/src/main/archetype/se/quickstart/quickstart-se.xml index 477764ea59f..77173e9b905 100644 --- a/archetypes/helidon/src/main/archetype/se/quickstart/quickstart-se.xml +++ b/archetypes/helidon/src/main/archetype/se/quickstart/quickstart-se.xml @@ -49,7 +49,7 @@ curl -X GET http://localhost:8080/greet/Jose helidon-webclient - + io.helidon.webclient diff --git a/microprofile/oidc/src/main/java/module-info.java b/microprofile/oidc/src/main/java/module-info.java index 12c3608bdd8..966d1e4c99e 100644 --- a/microprofile/oidc/src/main/java/module-info.java +++ b/microprofile/oidc/src/main/java/module-info.java @@ -29,5 +29,7 @@ exports io.helidon.microprofile.oidc; provides jakarta.enterprise.inject.spi.Extension with io.helidon.microprofile.oidc.OidcCdiExtension; + + opens io.helidon.microprofile.oidc to weld.core.impl; } \ No newline at end of file