Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MP on Níma #5176

Merged
merged 11 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion applications/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon</groupId>
Expand Down
2 changes: 1 addition & 1 deletion applications/se/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon.applications</groupId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/helidon/src/main/archetype/common/extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</list>
<list key="Main-helidon-imports" if="${flavor} == 'se'">
<value>io.helidon.reactive.webserver.cors.CorsSupport</value>
<value>io.helidon.reactive.webserver.cors.CrossOriginConfig</value>
<value>io.helidon.cors.CrossOriginConfig</value>
</list>
<list key="Main-createRouting" if="${flavor} == 'se'">
<value><![CDATA[
Expand Down
14 changes: 12 additions & 2 deletions archetypes/helidon/src/main/archetype/common/observability.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,15 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics
<map order="800" if="${flavor} == 'se'">
<value key="groupId">io.helidon.metrics</value>
<value key="artifactId">helidon-metrics</value>
<value key="scope">provided</value>
</map>
<map order="800" if="${flavor} == 'se'">
<value key="groupId">io.helidon.reactive.metrics</value>
<value key="artifactId">helidon-reactive-metrics</value>
</map>
</list>
<list key="Main-helidon-imports">
<value>io.helidon.metrics.MetricsSupport</value>
<value>io.helidon.reactive.metrics.MetricsSupport</value>
</list>
<list key="Main-routingBuilder">
<value><![CDATA[ .register(MetricsSupport.create()) // Metrics at "/metrics"]]></value>
Expand Down Expand Up @@ -331,10 +336,15 @@ allRequests_total 0.0
<map order="800" if="${flavor} == 'se' &amp;&amp; !(${metrics.provider} == 'microprofile')">
<value key="groupId">io.helidon.metrics</value>
<value key="artifactId">helidon-metrics</value>
<value key="scope">provided</value>
</map>
<map order="800" if="${flavor} == 'se' &amp;&amp; !(${metrics.provider} == 'microprofile')">
<value key="groupId">io.helidon.reactive.metrics</value>
<value key="artifactId">helidon-reactive-metrics</value>
</map>
</list>
<list key="Main-helidon-imports" if="!(${metrics.provider} == 'microprofile')">
<value>io.helidon.metrics.MetricsSupport</value>
<value>io.helidon.reactive.metrics.MetricsSupport</value>
</list>
<list key="Main-routingBuilder" if="!(${metrics.provider} == 'microprofile')">
<value><![CDATA[ .register(MetricsSupport.create()) // Metrics at "/metrics"]]></value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.helidon.reactive.webclient.WebClientRequestBuilder;
import io.helidon.reactive.webclient.WebClientRequestHeaders;
import io.helidon.reactive.webclient.WebClientResponse;
import io.helidon.reactive.webclient.WebClientResponseHeaders;
import io.helidon.reactive.webserver.cors.CrossOriginConfig;
import io.helidon.cors.CrossOriginConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.helidon.reactive.webclient.WebClientRequestHeaders;
import io.helidon.reactive.webclient.WebClientResponse;
import io.helidon.reactive.webclient.WebClientResponseHeaders;
import io.helidon.reactive.webserver.WebServer;
import io.helidon.reactive.webserver.cors.CrossOriginConfig;
import io.helidon.cors.CrossOriginConfig;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
Expand Down
65 changes: 55 additions & 10 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@
<artifactId>helidon-graphql-server</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.graphql</groupId>
<artifactId>helidon-nima-graphql-server</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.reactive.graphql</groupId>
<artifactId>helidon-reactive-graphql-server</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.graphql</groupId>
<artifactId>helidon-microprofile-graphql-server</artifactId>
Expand Down Expand Up @@ -245,6 +255,11 @@
<artifactId>helidon-reactive-media-multipart</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.reactive.metrics</groupId>
<artifactId>helidon-reactive-metrics</artifactId>
<version>${helidon.version}</version>
</dependency>
<!-- config -->
<dependency>
<groupId>io.helidon.config</groupId>
Expand Down Expand Up @@ -392,6 +407,11 @@
<artifactId>helidon-security-integration-webserver</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.security.integration</groupId>
<artifactId>helidon-security-integration-nima</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.security</groupId>
<artifactId>helidon-security-annotations</artifactId>
Expand Down Expand Up @@ -529,6 +549,11 @@
<artifactId>helidon-microprofile-websocket</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.service-common</groupId>
<artifactId>helidon-microprofile-service-common</artifactId>
<version>${helidon.version}</version>
</dependency>
<!-- metrics -->
<dependency>
<groupId>io.helidon.metrics</groupId>
Expand Down Expand Up @@ -621,16 +646,6 @@
<artifactId>helidon-common-context</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.service-common</groupId>
<artifactId>helidon-service-common-rest</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.service-common</groupId>
<artifactId>helidon-service-common-rest-cdi</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.common</groupId>
<artifactId>helidon-common-crypto</artifactId>
Expand Down Expand Up @@ -666,6 +681,11 @@
<artifactId>helidon-common-testing-http-junit5</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.reactive.service-common</groupId>
<artifactId>helidon-reactive-service-common</artifactId>
<version>${helidon.version}</version>
</dependency>

<!-- db client -->
<dependency>
Expand Down Expand Up @@ -1070,12 +1090,22 @@
<artifactId>helidon-openapi</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.reactive.openapi</groupId>
<artifactId>helidon-reactive-openapi</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.microprofile.openapi</groupId>
<artifactId>helidon-microprofile-openapi</artifactId>
<version>${helidon.version}</version>
</dependency>
<!-- CORS support -->
<dependency>
<groupId>io.helidon.cors</groupId>
<artifactId>helidon-cors</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.reactive.webserver.cors</groupId>
<artifactId>helidon-cors</artifactId>
Expand Down Expand Up @@ -1265,6 +1295,11 @@
<artifactId>helidon-nima-webserver-access-log</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.webserver</groupId>
<artifactId>helidon-nima-webserver-context</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.webserver</groupId>
<artifactId>helidon-nima-webserver-static-content</artifactId>
Expand Down Expand Up @@ -1325,6 +1360,11 @@
<artifactId>helidon-nima-observe-health</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-metrics</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.observe</groupId>
<artifactId>helidon-nima-observe-info</artifactId>
Expand All @@ -1345,6 +1385,11 @@
<artifactId>helidon-nima-fault-tolerance</artifactId>
<version>${helidon.version}</version>
</dependency>
<dependency>
<groupId>io.helidon.nima.openapi</groupId>
<artifactId>helidon-nima-openapi</artifactId>
<version>${helidon.version}</version>
</dependency>

<!-- Pico -->
<dependency>
Expand Down
11 changes: 11 additions & 0 deletions common/http/src/main/java/io/helidon/common/http/Http.java
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,17 @@ public static final class HeaderValues {
* Content length with 0 value.
*/
public static final HeaderValue CONTENT_LENGTH_ZERO = Header.createCached(Header.CONTENT_LENGTH, "0");
/**
* Cache control without any caching.
*/
public static final HeaderValue CACHE_NO_CACHE = Header.create(Header.CACHE_CONTROL, "no-cache",
"no-store",
"must-revalidate",
"no-transform");
/**
* Cache control that allows caching with no transform.
*/
public static final HeaderValue CACHE_NORMAL = Header.createCached(Header.CACHE_CONTROL, "no-transform");

private HeaderValues() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public boolean test(Http.Method t) {
public Set<Method> acceptedMethods() {
return Set.of();
}

@Override
public String toString() {
return "(any method)";
}
}

static class SingleMethodEnumPredicate implements MethodPredicate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.nima.webserver.http;
package io.helidon.common.http;

import io.helidon.common.uri.UriPath;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.nima.webserver.http;
package io.helidon.common.http;

import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -461,8 +461,8 @@ public MatchResult match(UriPath uriPath) {
@Override
public PrefixMatchResult prefixMatch(UriPath uriPath) {
return new PrefixMatchResult(true,
new NoParamRoutedPath(uriPath),
UriPath.create(""));
new NoParamRoutedPath(UriPath.create("")),
uriPath);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package io.helidon.nima.webserver.http;
package io.helidon.common.http;

import io.helidon.common.parameters.Parameters;
import io.helidon.common.uri.UriPath;
Expand Down
78 changes: 78 additions & 0 deletions cors/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2022 Oracle and/or its affiliates.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.helidon</groupId>
<artifactId>helidon-project</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>

<groupId>io.helidon.cors</groupId>
<artifactId>helidon-cors</artifactId>
<name>Helidon Cors</name>

<dependencies>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.common</groupId>
<artifactId>helidon-common-configurable</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.common</groupId>
<artifactId>helidon-common-http</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-metadata-processor</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
<artifactId>helidon-config-yaml</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.helidon.common.testing</groupId>
<artifactId>helidon-common-testing-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading