Skip to content

Commit 91008d5

Browse files
authored
OIDC and IDCS security providers now support native-image compilation. (helidon-io#1095)
Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
1 parent cbadef1 commit 91008d5

6 files changed

Lines changed: 54 additions & 5 deletions

File tree

security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public IdcsRoleMapperProvider build() {
220220
*/
221221
public B config(Config config) {
222222
super.config(config);
223-
config.get("cache-config").as(EvictableCache.class).ifPresent(this::roleCache);
223+
config.get("cache-config").as(EvictableCache::<String, List<Grant>>create).ifPresent(this::roleCache);
224224

225225
return me;
226226
}

security/providers/idcs-mapper/src/main/java/io/helidon/security/providers/idcs/mapper/IdcsRoleMapperProviderBase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ protected Builder() {
286286
* @return updated builder instance
287287
*/
288288
public B config(Config config) {
289-
config.get("oidc-config").as(OidcConfig.class).ifPresent(this::oidcConfig);
290-
config.get("subject-types").asList(SubjectType.class).ifPresent(list -> list.forEach(this::addSubjectType));
289+
config.get("oidc-config").as(OidcConfig::create).ifPresent(this::oidcConfig);
290+
config.get("subject-types").asList(cfg -> cfg.asString().map(SubjectType::valueOf).get())
291+
.ifPresent(list -> list.forEach(this::addSubjectType));
291292
config.get("default-idcs-subject-type").asString().ifPresent(this::defaultIdcsSubjectType);
292293
return me;
293294
}

security/providers/oidc-common/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<artifactId>helidon-security-jwt</artifactId>
4040
</dependency>
4141
<dependency>
42-
<groupId>io.helidon.jersey</groupId>
43-
<artifactId>helidon-jersey-client</artifactId>
42+
<groupId>io.helidon.webclient</groupId>
43+
<artifactId>helidon-webclient-jaxrs</artifactId>
4444
</dependency>
4545
<dependency>
4646
<groupId>io.helidon.jersey</groupId>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
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=-H:EnableURLProtocols=http \
18+
-H:EnableURLProtocols=https \
19+
--enable-all-security-services \
20+
--initialize-at-build-time=io.helidon.security.providers.oidc
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"name": "org.glassfish.jersey.client.JerseyClientBuilder",
4+
"allDeclaredConstructors": true,
5+
"allPublicConstructors": true,
6+
"allPublicMethods": true,
7+
"allDeclaredMethods": true
8+
}
9+
]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
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=-H:ReflectionConfigurationResources=${.}/helidon-webclient-jaxrs-reflection-config.json \
18+
-H:EnableURLProtocols=http \
19+
--initialize-at-build-time=io.helidon.webclient.jaxrs

0 commit comments

Comments
 (0)