Skip to content

Commit

Permalink
Closes #2616 - Make OpenAPI/Swagger UI docs public
Browse files Browse the repository at this point in the history
  • Loading branch information
CRoberto1926 authored and gitgoodjhe committed Aug 7, 2024
1 parent 712abf4 commit bbad969
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package pro.taskana.example.boot;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import io.swagger.v3.oas.models.media.ArraySchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.StringSchema;
Expand All @@ -18,8 +21,7 @@
title = "TASKANA RESTful API Documentation",
version = "8.2.0",
description =
""
+ "<h1>Overview</h1>"
"<h1>Overview</h1>"
+ "<p>"
+ "This is the REST documentation for [TASKANA](http://taskana.pro) - the "
+ "world’s first open source solution for Enterprise Task Management."
Expand Down Expand Up @@ -340,7 +342,9 @@
+ "<td>String</td>"
+ "</tr>"
+ "</tbody>"
+ "</table>"))
+ "</table>"),
security = {@SecurityRequirement(name = "basicAuth")})
@SecurityScheme(name = "basicAuth", type = SecuritySchemeType.HTTP, scheme = "basic")
public class OpenApiConfiguration {
@Bean
public OpenApiCustomizer openApiCustomizer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
authorizeHttpRequests
.requestMatchers("/css/**", "/img/**")
.permitAll()
.requestMatchers(HttpMethod.GET, "/docs/**")
.permitAll()
.requestMatchers(
HttpMethod.GET, "/docs/**", "/api-docs*")
HttpMethod.GET,
"/api-docs",
"/api-docs/**",
"/swagger-ui",
"/swagger-ui/**")
.permitAll())
.cors(Customizer.withDefaults())
.addFilter(jaasApiIntegrationFilter())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ taskana.schemaName=TASKANA
####### property that control rest api security deploy use true for no security.
devMode=false
# This property enables the support of XSRF tokens. This will not work together with devMode.
enableCsrf=true
enableCsrf=false
####### property that control if the database is cleaned and sample data is generated
generateSampleData=true
####### cache static resources properties
Expand Down

0 comments on commit bbad969

Please sign in to comment.