Skip to content

Commit 1f0195e

Browse files
authored
Updates to native image configuration to support latest release of GraalVM. (helidon-io#8838)
1 parent 97bcf73 commit 1f0195e

4 files changed

Lines changed: 44 additions & 3 deletions

File tree

  • common/configurable/src/main/resources/META-INF/native-image/io.helidon.common/helidon-common-configurable
  • integrations/graal/mp-native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-mp-graal-native-image-extension
  • logging/jul/src/main/resources/META-INF/native-image/io.helidon.logging/helidon-logging-jul
  • security/providers/oidc/src/main/java/io/helidon/security/providers/oidc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# Copyright (c) 2024 Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
Args=--initialize-at-build-time=io.helidon.common.configurable.LruCache \
18+
--initialize-at-build-time=io.helidon.common.configurable.LruCacheConfig

integrations/graal/mp-native-image-extension/src/main/resources/META-INF/native-image/io.helidon.integrations.graal/helidon-mp-graal-native-image-extension/native-image.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2019, 2023 Oracle and/or its affiliates.
2+
# Copyright (c) 2019, 2024 Oracle and/or its affiliates.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -40,7 +40,12 @@ Args=--features=io.helidon.integrations.graal.mp.nativeimage.extension.HelidonMp
4040
--initialize-at-build-time=jakarta.interceptor \
4141
--initialize-at-build-time=jakarta.annotation \
4242
--initialize-at-build-time=com.sun.beans.TypeResolver \
43+
--initialize-at-build-time=com.sun.beans.WeakCache \
4344
--initialize-at-build-time=java.beans.PropertyDescriptor \
4445
--initialize-at-build-time=java.beans.MethodRef \
4546
--initialize-at-build-time=org.yaml.snakeyaml \
47+
--initialize-at-build-time=org.jvnet.hk2 \
48+
--initialize-at-build-time=java.lang.annotation.Annotation \
49+
--initialize-at-build-time=io.helidon \
50+
--initialize-at-build-time=org.eclipse.microprofile \
4651
--report-unsupported-elements-at-runtime
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright (c) 2024 Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
Args=--initialize-at-build-time=io.helidon.logging.jul.JulMdcPropagator

security/providers/oidc/src/main/java/io/helidon/security/providers/oidc/TenantAuthenticationHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.stream.Collectors;
3939

4040
import io.helidon.common.Errors;
41+
import io.helidon.common.LazyValue;
4142
import io.helidon.common.parameters.Parameters;
4243
import io.helidon.http.HeaderNames;
4344
import io.helidon.http.HeaderValues;
@@ -83,7 +84,7 @@ class TenantAuthenticationHandler {
8384
private static final System.Logger LOGGER = System.getLogger(TenantAuthenticationHandler.class.getName());
8485
private static final TokenHandler PARAM_HEADER_HANDLER = TokenHandler.forHeader(OidcConfig.PARAM_HEADER_NAME);
8586
private static final TokenHandler PARAM_ID_HEADER_HANDLER = TokenHandler.forHeader(OidcConfig.PARAM_ID_HEADER_NAME);
86-
private static final SecureRandom RANDOM = new SecureRandom();
87+
private static final LazyValue<SecureRandom> RANDOM = LazyValue.create(SecureRandom::new);
8788

8889
private final boolean optional;
8990
private final OidcConfig oidcConfig;
@@ -824,7 +825,7 @@ private static String generateRandomString() {
824825
int rightLimit = 122; // letter 'z'
825826
int targetStringLength = 10;
826827

827-
return RANDOM.ints(leftLimit, rightLimit + 1)
828+
return RANDOM.get().ints(leftLimit, rightLimit + 1)
828829
.filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97))
829830
.limit(targetStringLength)
830831
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)

0 commit comments

Comments
 (0)