Skip to content

Commit

Permalink
feat: [SRTP-91] Add role based authorization (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrea Morabito <andrea.morabito@pagopa.it>
Co-authored-by: Luca Consalvi <luca.consalvi@pagopa.it>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent 886e33d commit 570efbe
Show file tree
Hide file tree
Showing 13 changed files with 1,290 additions and 0 deletions.
55 changes: 55 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.graalvm.buildtools.native' version '0.10.3'
id("org.openapi.generator") version "7.5.0"
}

group = 'it.gov.pagopa'
Expand All @@ -25,9 +26,22 @@ repositories {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'

// spring security + oauth2 resource server
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'org.springframework.security:spring-security-oauth2-jose'

implementation("org.springframework.boot:spring-boot-starter-actuator")

// implementation 'com.azure.spring:spring-cloud-azure-starter-actuator'
// implementation 'com.azure.spring:spring-cloud-azure-starter-data-cosmos'
implementation("io.swagger.core.v3:swagger-annotations:2.2.8")
implementation("org.openapitools:jackson-databind-nullable:0.2.6")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("org.springframework.boot:spring-boot-starter-validation")
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'io.projectreactor:reactor-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
Expand All @@ -41,3 +55,44 @@ dependencyManagement {
tasks.named('test') {
useJUnitPlatform()
}

tasks.compileJava {
dependsOn("openApiGenerate")
}

sourceSets {
main {
java {
srcDir("$projectDir/build/generated/src/main/java")
}
}
}

openApiGenerate {
generatorName.set("spring")
inputSpec.set("$rootDir/openapi/activation.openapi.yaml")
outputDir.set("$projectDir/build/generated")
apiPackage.set("it.gov.pagopa.rtp.activator.controller.generated")
modelPackage.set("it.gov.pagopa.rtp.activator.model.generated")
modelNameSuffix.set("Dto")
generateApiTests.set(false)
generateApiDocumentation.set(false)
generateApiTests.set(false)
generateModelTests.set(false)
library.set("spring-boot")
configOptions.set([
"dateLibrary" : "java8",
"useSpringBoot3" : "true",
"interfaceOnly" : "true",
"useTags" : "true",
"useSwaggerUI" : "false",
"reactive" : "true",
"swaggerAnnotations" : "false",
"skipDefaultInterface" : "true",
"openApiNullable" : "true",
])
typeMappings.set([
"DateTime" : "java.time.LocalDateTime",
"zoned-date-time" : "java.time.ZonedDateTime"
])
}
Loading

0 comments on commit 570efbe

Please sign in to comment.