-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static content for Graal native-image (#962)
* Upgrade GraalVM to 19.2.0 Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Support security algorithms in Graal native-image. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Static content update to work with any classpath resource. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Integration test for Graal native-image. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Copyright fixes. Signed-off-by: Tomas Langer <tomas.langer@oracle.com> * Fix directory behavior when classpath based on files. Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
- Loading branch information
1 parent
8c1d15f
commit 70e49db
Showing
27 changed files
with
1,431 additions
and
115 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
config/encryption/src/main/resources/META-INF/native-image/native-image.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. | ||
# | ||
# 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. | ||
# | ||
Args=--enable-all-security-services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. | ||
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.tests.integration</groupId> | ||
<artifactId>helidon-tests-integration</artifactId> | ||
<version>1.2.2-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<packaging>pom</packaging> | ||
|
||
<artifactId>helidon-tests-integration-native-image</artifactId> | ||
<name>Helidon Tests GraalVM Native image</name> | ||
|
||
<description> | ||
A set of tests that make sure various Helidon modules can compile with native-image. | ||
</description> | ||
|
||
<modules> | ||
<module>se-1</module> | ||
<module>static-content</module> | ||
</modules> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#GraalVM native image integration test | ||
_____ | ||
|
||
This is a manual (for the time being) test of integration with native-image. | ||
|
||
To run this test: | ||
|
||
```shell script | ||
mvn clean package -Pnative-image | ||
./target/helidon-tests-native-image-se-1 | ||
``` | ||
|
||
Once the native image builds and is started, run the following | ||
curl requests: | ||
|
||
```shell script | ||
# Should return 200 code and "file-resource-text" as entity | ||
curl -i http://localhost:7076/static/path/resource.txt | ||
|
||
# Should return 200 code and "classpath-resource-text" as entity | ||
curl -i http://localhost:7076/static/classpath/resource.txt | ||
|
||
# Should return 200 code and "jar-resource-text" as entity | ||
curl -i http://localhost:7076/static/jar/resource.txt | ||
|
||
# Should return 200 code and "{"message":"SE Hallo World!"}" as entity | ||
curl -i http://localhost:7076/greet | ||
|
||
# Should return 401 code | ||
curl -i http://localhost:7076/greet/john | ||
|
||
# Should return 200 code and "{"message":"SE Hallo jack!"}" as entity | ||
curl -i -u jack:password http://localhost:7076/greet/john | ||
|
||
# Should return 200 code and JSON response with two health checks | ||
curl -i http://localhost:7076/health | ||
|
||
# Should return 200 code and JSON response with metrics | ||
curl -i -H "Accept: application/json" http://localhost:7076/metrics | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
app: | ||
greeting: "SE Hallo" | ||
|
||
security: | ||
provider-policy: | ||
type: "COMPOSITE" | ||
authentication: | ||
- name: "http-signatures" | ||
flag: "OPTIONAL" | ||
- name: "http-basic-auth" | ||
providers: | ||
# enable the "ABAC" security provider (also handles RBAC) | ||
- abac: | ||
# enabled the HTTP Basic authentication provider | ||
- http-basic-auth: | ||
realm: "helidon" | ||
users: | ||
- login: "jack" | ||
password: "password" | ||
roles: ["admin"] | ||
- login: "jill" | ||
password: "password" | ||
roles: ["user"] | ||
- login: "joe" | ||
password: "password" | ||
- http-signatures: | ||
optional: true | ||
sign-headers: | ||
- method: "get" | ||
always: ["date", "(request-target)", "host"] | ||
if-present: [] | ||
inbound.keys: | ||
- key-id: "helidon-mp" | ||
principal-name: "MP Service" | ||
principal-type: "SERVICE" | ||
hmac.secret: "badIdeaClearTextPassword!" | ||
web-server: | ||
paths: | ||
- path: "/greet/{*}" | ||
authenticate: true | ||
roles-allowed: ["user", "admin"] |
Oops, something went wrong.