-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added modules * [client-api]: refactored client refactored security configuration
- Loading branch information
Showing
122 changed files
with
671 additions
and
196 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
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,12 @@ | ||
plugins { | ||
id("java") | ||
id("org.springframework.boot") | ||
id("io.spring.dependency-management") | ||
id("dev.vlaship.lombok") | ||
} | ||
|
||
dependencies{ | ||
implementation(libs.springdoc) | ||
implementation("jakarta.validation:jakarta.validation-api") | ||
implementation("org.springframework.data:spring-data-commons") | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,57 @@ | ||
plugins { | ||
id("java") | ||
id("org.springframework.boot") | ||
id("io.spring.dependency-management") | ||
id("dev.vlaship.lombok") | ||
id("dev.vlaship.unpack") | ||
id("dev.vlaship.git-properties") | ||
} | ||
|
||
val jwtVersion = "0.12.3" // "0.11.5" works with graalvm | ||
val openApiVersion = "2.3.0" | ||
val mapstructVersion = "1.5.5.Final" | ||
val preLiquibaseVersion = "1.5.0" | ||
val openTelemetryVersion = "2.0.0" | ||
val micrometerVersion = "1.2.2" | ||
val findbugsVersion = "3.0.2" | ||
|
||
dependencies { | ||
implementation(project(":backoffice-api")) | ||
|
||
// avoid warnings | ||
compileOnly("com.google.code.findbugs:jsr305:$findbugsVersion") | ||
|
||
// security | ||
implementation("org.springframework.boot:spring-boot-starter-security") | ||
implementation("io.jsonwebtoken:jjwt-api:$jwtVersion") | ||
implementation("io.jsonwebtoken:jjwt-impl:$jwtVersion") | ||
implementation("io.jsonwebtoken:jjwt-jackson:$jwtVersion") | ||
|
||
// web | ||
implementation(libs.springdoc) | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
implementation("org.springframework.boot:spring-boot-starter-validation") | ||
|
||
// mapper | ||
compileOnly("org.mapstruct:mapstruct:$mapstructVersion") | ||
annotationProcessor("org.mapstruct:mapstruct-processor:$mapstructVersion") | ||
|
||
// db | ||
runtimeOnly("org.postgresql:postgresql") | ||
implementation("org.liquibase:liquibase-core") | ||
implementation("net.lbruun.springboot:preliquibase-spring-boot-starter:$preLiquibaseVersion") | ||
implementation("org.springframework.boot:spring-boot-starter-data-jpa") | ||
|
||
// actuator | ||
implementation("org.springframework.boot:spring-boot-starter-actuator") | ||
implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:$openTelemetryVersion") | ||
implementation("io.micrometer:micrometer-tracing-bridge-brave") | ||
|
||
// test | ||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
testImplementation("org.springframework.security:spring-security-test") | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
backoffice-app/src/main/java/dev/vlaship/backoffice/security/JwtConfig.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,19 @@ | ||
package dev.vlaship.backoffice.security; | ||
|
||
import io.jsonwebtoken.io.Decoders; | ||
import io.jsonwebtoken.security.Keys; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.crypto.SecretKey; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(JwtProperties.class) | ||
public class JwtConfig { | ||
|
||
@Bean | ||
public SecretKey secretKey(JwtProperties jwtProperties) { | ||
return Keys.hmacShaKeyFor(Decoders.BASE64.decode(jwtProperties.secret())); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
backoffice-app/src/main/java/dev/vlaship/backoffice/security/JwtProperties.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,10 @@ | ||
package dev.vlaship.backoffice.security; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties("jwt") | ||
public record JwtProperties( | ||
String secret, | ||
long expirationSeconds | ||
) { | ||
} |
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
File renamed without changes.
Oops, something went wrong.