Merge pull request #12319 from navuluri/BAEL-5534

Bael 5534
This commit is contained in:
kwoyke 2022-06-07 09:17:53 +02:00 committed by GitHub
commit 58ddbdaf29
5 changed files with 20 additions and 22 deletions

View File

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-boot-springdoc</artifactId>
<version>0.0.1-SNAPSHOT</version>
@ -112,6 +110,8 @@
<include>application.properties</include>
<include>data.sql</include>
<include>schema.sql</include>
<include>app.key</include>
<include>app.pub</include>
</includes>
</resource>
</resources>

View File

@ -52,8 +52,9 @@ public class SecurityConfiguration {
//@formatter:off
return http
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
.antMatchers("/api/auth/**", "/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/webjars/**",
"/swagger-ui/index.html")
.antMatchers("/api/auth/**", "/swagger-ui-custom.html" ,"/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**", "/webjars/**",
"/swagger-ui/index.html","/api-docs/**")
.permitAll()
.anyRequest()
.authenticated())

View File

@ -11,7 +11,6 @@ public class SecurityTokenApplication {
* @param args
*/
public static void main(String[] args) {
SpringApplication.run(SecurityTokenApplication.class, args);
SpringApplication.run(SecurityTokenApplication.class);
}
}

View File

@ -30,7 +30,7 @@ class OpenApiJwtIntegrationTest
{
assertNotNull(authenticationApi);
String response = this.restTemplate.getForObject("http://localhost:" + port + "/swagger-ui.html", String.class);
String response = this.restTemplate.getForObject("http://localhost:" + port + "/swagger-ui/index.html", String.class);
assertNotNull(response);
assertTrue(response.contains("Swagger UI"));
@ -43,8 +43,7 @@ class OpenApiJwtIntegrationTest
{
assertNotNull(authenticationApi);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/v3/api-docs",
String.class);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
assertNotNull(response);
assertEquals(HttpStatus.OK, response.getStatusCode());
@ -59,8 +58,8 @@ class OpenApiJwtIntegrationTest
{
assertNotNull(authenticationApi);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/v3/api-docs",
String.class);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
assertNotNull(response);
assertNotNull(response.getBody());
@ -75,8 +74,7 @@ class OpenApiJwtIntegrationTest
{
assertNotNull(authenticationApi);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/v3/api-docs",
String.class);
ResponseEntity<String> response = this.restTemplate.getForEntity("http://localhost:" + port + "/api-docs", String.class);
assertNotNull(response);
assertNotNull(response.getBody());