Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into path-fix
Browse files Browse the repository at this point in the history
# Conflicts:
#	openapi/generated.openapi.json
#	src/test/java/it/gov/pagopa/pu/organization/OpenApiGeneratorTest.java
  • Loading branch information
ElisKina-dev committed Jan 8, 2025
2 parents 64bd538 + 7c7ee7c commit ab9af31
Show file tree
Hide file tree
Showing 17 changed files with 361 additions and 98 deletions.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ val springDocOpenApiVersion = "2.7.0"
val openApiToolsVersion = "0.2.6"
val micrometerVersion = "1.4.1"
val postgresJdbcVersion = "42.7.4"
val bouncycastleVersion = "1.79"

dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.boot:spring-boot-starter-data-rest")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-actuator")
Expand All @@ -44,6 +46,9 @@ dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("org.openapitools:jackson-databind-nullable:$openApiToolsVersion")

//security
implementation("org.bouncycastle:bcprov-jdk18on:$bouncycastleVersion")

//postgres jdbc
implementation("org.postgresql:postgresql:$postgresJdbcVersion")

Expand Down
11 changes: 11 additions & 0 deletions gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2=compileClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2=compileClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.18.2=compileClasspath
com.fasterxml.jackson:jackson-bom:2.18.2=compileClasspath
com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath
com.jayway.jsonpath:json-path:2.9.0=compileClasspath
com.nimbusds:nimbus-jose-jwt:9.37.3=compileClasspath
com.zaxxer:HikariCP:5.1.0=compileClasspath
io.micrometer:context-propagation:1.1.2=compileClasspath
io.micrometer:micrometer-commons:1.14.2=compileClasspath
Expand Down Expand Up @@ -50,6 +52,7 @@ org.apache.tomcat.embed:tomcat-embed-el:10.1.34=compileClasspath
org.apache.tomcat.embed:tomcat-embed-websocket:10.1.34=compileClasspath
org.aspectj:aspectjweaver:1.9.22.1=compileClasspath
org.atteo:evo-inflector:1.3=compileClasspath
org.bouncycastle:bcprov-jdk18on:1.79=compileClasspath
org.hibernate.orm:hibernate-core:6.6.4.Final=compileClasspath
org.jspecify:jspecify:1.0.0=compileClasspath
org.openapitools:jackson-databind-nullable:0.2.6=compileClasspath
Expand All @@ -69,6 +72,7 @@ org.springframework.boot:spring-boot-starter-data-rest:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-jdbc:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-json:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-logging:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-oauth2-resource-server:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-tomcat:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter-web:3.4.1=compileClasspath
org.springframework.boot:spring-boot-starter:3.4.1=compileClasspath
Expand All @@ -79,6 +83,13 @@ org.springframework.data:spring-data-rest-core:4.4.1=compileClasspath
org.springframework.data:spring-data-rest-webmvc:4.4.1=compileClasspath
org.springframework.hateoas:spring-hateoas:2.4.1=compileClasspath
org.springframework.plugin:spring-plugin-core:3.0.0=compileClasspath
org.springframework.security:spring-security-config:6.4.2=compileClasspath
org.springframework.security:spring-security-core:6.4.2=compileClasspath
org.springframework.security:spring-security-crypto:6.4.2=compileClasspath
org.springframework.security:spring-security-oauth2-core:6.4.2=compileClasspath
org.springframework.security:spring-security-oauth2-jose:6.4.2=compileClasspath
org.springframework.security:spring-security-oauth2-resource-server:6.4.2=compileClasspath
org.springframework.security:spring-security-web:6.4.2=compileClasspath
org.springframework:spring-aop:6.2.1=compileClasspath
org.springframework:spring-aspects:6.2.1=compileClasspath
org.springframework:spring-beans:6.2.1=compileClasspath
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ microservice-chart:
resources:
requests:
memory: "256Mi"
cpu: "40m"
cpu: "100m"
limits:
memory: "4Gi"
cpu: "300m"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ microservice-chart:
resources:
requests:
memory: "256Mi"
cpu: "40m"
cpu: "100m"
limits:
memory: "4Gi"
cpu: "300m"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ microservice-chart:
resources:
requests:
memory: "256Mi"
cpu: "40m"
cpu: "100m"
limits:
memory: "4Gi"
cpu: "300m"
Expand Down
1 change: 1 addition & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ microservice-chart:
ORGANIZATION_DB_USER: db-mypay-login-username
ORGANIZATION_DB_PASSWORD: db-mypay-login-password
BROKER_ENCRYPT_PASSWORD: broker-encrypt-password
JWT_TOKEN_PUBLIC_KEY: jwt-public-key

# nodeSelector: {}

Expand Down
86 changes: 48 additions & 38 deletions openapi/generated.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"url" : "http://localhost",
"description" : "Generated server url"
} ],
"security" : [ {
"BearerAuth" : [ ]
} ],
"tags" : [ {
"name" : "Broker",
"description" : "the Broker API"
} ],
"paths" : {
"/crud/brokers" : {
"/brokers" : {
"get" : {
"tags" : [ "broker-entity-controller" ],
"description" : "get-broker",
Expand Down Expand Up @@ -102,7 +105,7 @@
}
}
},
"/crud/brokers/search/findByOrgFiscalCode" : {
"/brokers/search/findByOrgFiscalCode" : {
"get" : {
"tags" : [ "broker-search-controller" ],
"operationId" : "executeSearch-broker-get",
Expand Down Expand Up @@ -130,7 +133,7 @@
}
}
},
"/crud/brokers/{id}" : {
"/brokers/{id}" : {
"get" : {
"tags" : [ "broker-entity-controller" ],
"description" : "get-broker",
Expand Down Expand Up @@ -267,7 +270,7 @@
}
}
},
"/crud/organizations" : {
"/organizations" : {
"get" : {
"tags" : [ "organization-entity-controller" ],
"description" : "get-organization",
Expand Down Expand Up @@ -355,7 +358,7 @@
}
}
},
"/crud/organizations/search/findByIpaCode" : {
"/organizations/search/findByIpaCode" : {
"get" : {
"tags" : [ "organization-search-controller" ],
"operationId" : "executeSearch-organization-get",
Expand Down Expand Up @@ -383,7 +386,7 @@
}
}
},
"/crud/organizations/{id}" : {
"/organizations/{id}" : {
"get" : {
"tags" : [ "organization-entity-controller" ],
"description" : "get-organization",
Expand Down Expand Up @@ -520,7 +523,7 @@
}
}
},
"/crud/profile" : {
"/profile" : {
"get" : {
"tags" : [ "profile-controller" ],
"operationId" : "listAllFormsOfMetadata",
Expand All @@ -538,7 +541,7 @@
}
}
},
"/crud/profile/brokers" : {
"/profile/brokers" : {
"get" : {
"tags" : [ "profile-controller" ],
"operationId" : "descriptor",
Expand Down Expand Up @@ -566,7 +569,7 @@
}
}
},
"/crud/profile/organizations" : {
"/profile/organizations" : {
"get" : {
"tags" : [ "profile-controller" ],
"operationId" : "descriptor_1",
Expand Down Expand Up @@ -740,32 +743,6 @@
}
}
},
"PersonalisationFe" : {
"type" : "object",
"properties" : {
"headerAssistanceUrl" : {
"type" : "string"
},
"logoFooterImg" : {
"type" : "string"
},
"footerDescText" : {
"type" : "string"
},
"footerPrivacyInfoUrl" : {
"type" : "string"
},
"footerGDPRUrl" : {
"type" : "string"
},
"footerTermsCondUrl" : {
"type" : "string"
},
"footerAccessibilityUrl" : {
"type" : "string"
}
}
},
"EntityModelBroker" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -840,7 +817,7 @@
"_embedded" : {
"type" : "object",
"properties" : {
"brokers" : {
"broker" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/EntityModelBroker"
Expand All @@ -856,6 +833,32 @@
}
}
},
"PersonalisationFe" : {
"type" : "object",
"properties" : {
"headerAssistanceUrl" : {
"type" : "string"
},
"logoFooterImg" : {
"type" : "string"
},
"footerDescText" : {
"type" : "string"
},
"footerPrivacyInfoUrl" : {
"type" : "string"
},
"footerGDPRUrl" : {
"type" : "string"
},
"footerTermsCondUrl" : {
"type" : "string"
},
"footerAccessibilityUrl" : {
"type" : "string"
}
}
},
"EntityModelOrganization" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -975,7 +978,7 @@
"_embedded" : {
"type" : "object",
"properties" : {
"organizations" : {
"organization" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/EntityModelOrganization"
Expand Down Expand Up @@ -1188,6 +1191,13 @@
}
}
}
},
"securitySchemes" : {
"BearerAuth" : {
"type" : "http",
"scheme" : "bearer",
"bearerFormat" : "JWT"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
package it.gov.pagopa.pu.organization.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
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 org.springframework.context.annotation.Configuration;

/**
* The Class SwaggerConfig.
*/
@Configuration
@OpenAPIDefinition(
info = @Info(
title = "${spring.application.name}",
version = "${spring.application.version}",
description = "Api and Models"
),
security = @SecurityRequirement(name = "BearerAuth")
)
@SecurityScheme(
name = "BearerAuth",
type = SecuritySchemeType.HTTP,
bearerFormat = "JWT",
scheme = "bearer"
)
public class SwaggerConfig {

/** The title. */
private final String title;

/** The description. */
private final String description;

/** The version. */
private final String version;

public SwaggerConfig(
@Value("${swagger.title:${spring.application.name}}") String title,
@Value("${swagger.description:Api and Models}") String description,
@Value("${swagger.version:${spring.application.version}}") String version) {
this.title = title;
this.description = description;
this.version = version;
}

@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI().components(new Components()).info(new Info()
.title(title)
.description(description)
.version(version));
}
}
Loading

0 comments on commit ab9af31

Please sign in to comment.