-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#281 Implemented Dockerfile and deployed the backend on render.com.
- Loading branch information
Showing
6 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM openjdk:17-jdk | ||
WORKDIR /app | ||
COPY target/resq-0.0.1-SNAPSHOT.jar /app/app.jar | ||
COPY target/project_env /app/config | ||
ENV resq.appdir=/app/config | ||
ENTRYPOINT ["java","-jar","/app/app.jar"] |
47 changes: 47 additions & 0 deletions
47
resq/backend/resq/src/main/java/com/groupa1/resq/config/OpenApiConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.groupa1.resq.config; | ||
|
||
import io.swagger.v3.oas.annotations.enums.ParameterIn; | ||
import io.swagger.v3.oas.models.Components; | ||
import io.swagger.v3.oas.models.OpenAPI; | ||
import io.swagger.v3.oas.models.media.StringSchema; | ||
import io.swagger.v3.oas.models.parameters.Parameter; | ||
import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
import io.swagger.v3.oas.models.security.SecurityScheme; | ||
import org.springdoc.core.customizers.OperationCustomizer; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class OpenApiConfig { | ||
@Bean | ||
public OperationCustomizer customGlobalHeaders() { | ||
return (operation, handlerMethod) -> { | ||
|
||
// Add role to all endpoints | ||
Parameter missingParam2 = new Parameter().in(ParameterIn.HEADER.toString()) | ||
.name("X-Selected-Role") | ||
.schema(new StringSchema()) | ||
.description("ROLE"); | ||
|
||
operation.addParametersItem(missingParam2); | ||
|
||
return operation; | ||
}; | ||
} | ||
|
||
@Bean | ||
public OpenAPI customizeOpenAPI() { | ||
final String securitySchemeName = "bearerAuth"; | ||
// Add JWT token to all endpoints | ||
return new OpenAPI() | ||
.addSecurityItem(new SecurityRequirement() | ||
.addList(securitySchemeName)) | ||
.components(new Components() | ||
.addSecuritySchemes(securitySchemeName, new SecurityScheme() | ||
.name(securitySchemeName) | ||
.type(SecurityScheme.Type.HTTP) | ||
.scheme("bearer") | ||
.bearerFormat("JWT"))); | ||
} | ||
} | ||
|
10 changes: 2 additions & 8 deletions
10
resq/backend/resq/src/main/java/com/groupa1/resq/request/CreateTaskRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters