Skip to content

Commit 76c9785

Browse files
authored
Merge pull request #59 from entur/feat/SIK-1688
feat: Changed actuator permit from actuator/** too individual paths.
1 parent 01af9f1 commit 76c9785

File tree

5 files changed

+46
-6
lines changed

5 files changed

+46
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# [Release notes](https://github.com/entur/oidc-auth-client)
22

3+
## oidc-auth-resource-server v2.0.0
4+
* Changed actuator permit from actuator/** too individual paths.
5+
36
## oidc-auth-resource-server v1.1.4
47
* Add support for parameter annotation in JUnit test classes.
58

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
group=org.entur.auth.resource-server
2-
version=1.1.5-SNAPSHOT
2+
version=2.0.0-SNAPSHOT
33

44
org.gradle.jvmargs=-Xms128m -Xmx2048m

oidc-rs-junit-tenant/src/main/java/org/entur/auth/junit/jwt/JwtTokenFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public boolean containsTenant(Provider provider, String tenant) {
116116
* @param audience (optional) array of audience values; may be {@code null}
117117
* @param claims (optional) additional custom claims to include; may be {@code null}
118118
* @param expiresAt the expiration time of the token (must be in the future)
119-
* @return a signed JWT compactserialization string
119+
* @return a signed JWT compact serialization string
120120
* @throws IllegalArgumentException if no key pair exists for the given {@code provider}/{@code
121121
* domain}
122122
*/

oidc-rs-spring-boot-web-config/src/main/java/org/entur/auth/spring/config/authorization/AuthorizationHelper.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,27 @@ public static void configure(
2323
AuthorizationPermitAllProperties permitAll = authorization.getPermitAll();
2424

2525
if (permitAll.isActuator() && managementBasePath != null) {
26-
authorizeRequests.requestMatchers(managementBasePath + "/**").permitAll();
27-
log.info("All authorize requests to {}/** will be permitted", managementBasePath);
26+
authorizeRequests
27+
.requestMatchers(
28+
HttpMethod.GET,
29+
managementBasePath,
30+
managementBasePath + "/prometheus",
31+
managementBasePath + "/info",
32+
managementBasePath + "/metrics",
33+
managementBasePath + "/health",
34+
managementBasePath + "/health/readiness",
35+
managementBasePath + "/health/liveness")
36+
.permitAll();
37+
38+
log.info(
39+
"All authorize requests to {}, {}/prometheus, {}/info, {}/metrics, {}/health, {}/health/readiness, {}/health/liveness will be permitted",
40+
managementBasePath,
41+
managementBasePath,
42+
managementBasePath,
43+
managementBasePath,
44+
managementBasePath,
45+
managementBasePath,
46+
managementBasePath);
2847
}
2948

3049
if (permitAll.isOpenApi()) {

oidc-rs-spring-boot-webflux-config/src/main/java/org/entur/auth/spring/config/authorization/ReactiveAuthorizationHelper.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,26 @@ public static void configure(
2121
AuthorizationPermitAllProperties permitAll = authorization.getPermitAll();
2222

2323
if (permitAll.isActuator() && managementBasePath != null) {
24-
authorizeExchangeSpec.pathMatchers(managementBasePath + "/**").permitAll();
25-
log.info("All authorize requests to {}/** will be permitted", managementBasePath);
24+
authorizeExchangeSpec
25+
.pathMatchers(
26+
managementBasePath,
27+
managementBasePath + "/prometheus",
28+
managementBasePath + "/info",
29+
managementBasePath + "/metrics",
30+
managementBasePath + "/health",
31+
managementBasePath + "/health/readiness",
32+
managementBasePath + "/health/liveness")
33+
.permitAll();
34+
35+
log.info(
36+
"All authorize requests to {}, {}/prometheus, {}/info, {}/metrics, {}/health, {}/health/readiness, {}/health/liveness will be permitted",
37+
managementBasePath,
38+
managementBasePath,
39+
managementBasePath,
40+
managementBasePath,
41+
managementBasePath,
42+
managementBasePath,
43+
managementBasePath);
2644
}
2745

2846
if (permitAll.isOpenApi()) {

0 commit comments

Comments
 (0)