Skip to content

Commit 03ad68c

Browse files
authored
Merge pull request #68 from onewelcome/add-unauthenticated-path
Add unauthenticated path for cert pinning testing
2 parents 4c02860 + df2cf09 commit 03ad68c

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

pom.xml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@
3232
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3333

3434
<!-- Resource Gateway dependencies -->
35-
<onegini-communication-resiliency-starter.version>3.0.0</onegini-communication-resiliency-starter.version>
36-
<spring-boot.version>2.7.7</spring-boot.version>
35+
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
36+
<jib-maven-plugin.version>3.3.1</jib-maven-plugin.version>
37+
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
38+
<maven-enforcer-plugin.version>3.2.1</maven-enforcer-plugin.version>
39+
<onegini-communication-resiliency-starter.version>3.2.2</onegini-communication-resiliency-starter.version>
40+
<snakeyaml.version>2.0</snakeyaml.version>
41+
<spring-boot.version>2.7.9</spring-boot.version>
3742
</properties>
3843

3944
<licenses>
@@ -46,6 +51,13 @@
4651

4752
<dependencyManagement>
4853
<dependencies>
54+
<!-- Overridden to fix CVE-2022-1471, remove this override once spring boot supports this version.
55+
Latest spring boot version when writing: 2.7.9 -->
56+
<dependency>
57+
<groupId>org.yaml</groupId>
58+
<artifactId>snakeyaml</artifactId>
59+
<version>${snakeyaml.version}</version>
60+
</dependency>
4961
<dependency>
5062
<!-- Import dependency management from Spring Boot -->
5163
<groupId>org.springframework.boot</groupId>
@@ -108,7 +120,7 @@
108120
<plugin>
109121
<groupId>org.apache.maven.plugins</groupId>
110122
<artifactId>maven-enforcer-plugin</artifactId>
111-
<version>3.1.0</version>
123+
<version>${maven-enforcer-plugin.version}</version>
112124
<executions>
113125
<execution>
114126
<id>enforce-no-snapshots</id>
@@ -130,7 +142,7 @@
130142
<plugin>
131143
<groupId>org.apache.maven.plugins</groupId>
132144
<artifactId>maven-compiler-plugin</artifactId>
133-
<version>3.10.1</version>
145+
<version>${maven-compiler-plugin.version}</version>
134146
</plugin>
135147
<plugin>
136148
<groupId>org.springframework.boot</groupId>
@@ -140,12 +152,12 @@
140152
<plugin>
141153
<groupId>pl.project13.maven</groupId>
142154
<artifactId>git-commit-id-plugin</artifactId>
143-
<version>4.9.10</version>
155+
<version>${git-commit-id-plugin.version}</version>
144156
</plugin>
145157
<plugin>
146158
<groupId>com.google.cloud.tools</groupId>
147159
<artifactId>jib-maven-plugin</artifactId>
148-
<version>3.3.1</version>
160+
<version>${jib-maven-plugin.version}</version>
149161
</plugin>
150162
</plugins>
151163
</build>

src/main/java/com/onegini/examples/resourcegateway/web/ResourcesController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import static org.springframework.http.HttpHeaders.AUTHORIZATION;
77
import static org.springframework.http.HttpHeaders.CONTENT_TYPE;
88
import static org.springframework.http.HttpStatus.OK;
9+
import static org.springframework.web.bind.annotation.RequestMethod.GET;
10+
import static org.springframework.web.bind.annotation.RequestMethod.POST;
911

1012
import com.onegini.examples.resourcegateway.model.ApplicationDetails;
1113
import com.onegini.examples.resourcegateway.model.DecoratedUser;
@@ -115,6 +117,12 @@ public void postResource(@RequestHeader(name = AUTHORIZATION, required = false)
115117
response.flushBuffer();
116118
}
117119

120+
//For certificate pinning sdk testing
121+
@RequestMapping(path ="/unauthenticated", method = { GET, POST })
122+
public ResponseEntity<String> unauthenticated() {
123+
return new ResponseEntity<>("OK", OK);
124+
}
125+
118126
private void validateScopeAndTokenType(final TokenIntrospectionResult tokenIntrospectionResult, final String requiredScope) {
119127
scopeValidationService.validateScopeGranted(tokenIntrospectionResult.getScope(), requiredScope);
120128
tokenTypeValidationService.validateNoImplicitAuthenticationToken(tokenIntrospectionResult.getAmr());

0 commit comments

Comments
 (0)