From d3906cf7b293e0b0a3ae5a044f84df9ca01f951b Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 2 Oct 2023 12:50:52 +0100 Subject: [PATCH 01/37] Changed build process to add exec-jar Added spring-maven dependency execution for fat-jar Added maven-version plugin Updated to version 1.1.1 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 13 ++++++++----- sts-common/pom.xml | 13 ++++++++++++- sts-example/pom.xml | 11 ++++++++++- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 11 ++++++++++- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 11 ++++++++++- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 65 insertions(+), 24 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 32394735..c7ef8ca4 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.1 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index ddf85c09..a9c94c59 100644 --- a/pom.xml +++ b/pom.xml @@ -5,15 +5,13 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.1 pom SecureTokenService https://github.com/adorsys/secure-token-service SecureTokenService modules - - The Apache License, Version 2.0 @@ -84,7 +82,7 @@ sts-secret sts-simple-encryption keycloak-storage-provider - + @@ -565,7 +563,7 @@ maven-gpg-plugin 3.0.1 - opensource@adorsys.de + opensource@adorsys.de --pinentry-mode loopback @@ -604,6 +602,11 @@ + + org.codehaus.mojo + versions-maven-plugin + 2.14.2 + diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 9fec8b2c..7835af3c 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.1 sts-common @@ -91,6 +91,17 @@ org.springframework.boot spring-boot-maven-plugin + + + fat-jar + + repackage + + + exec + + + -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10022 diff --git a/sts-example/pom.xml b/sts-example/pom.xml index c2c7fa59..868d39a6 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 @@ -35,6 +35,15 @@ spring-boot-maven-plugin ${spring-boot.version} + + fat-jar + + repackage + + + exec + + repackage diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index d5499401..aa25fb64 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index a2da82a1..88538b55 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 8d291e40..4d6fbf7e 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.0 + 1.1.1 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index ba3b7f96..3cc3b6f1 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 1cb0fd8e..9f16b6c2 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index feebc19a..ee0a3d9d 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 68c9e19a..96607a35 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 8849e3e8..d49087ee 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 @@ -180,6 +180,15 @@ spring-boot-maven-plugin ${spring-boot.version} + + fat-jar + + repackage + + + exec + + build-info diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index b3af18d7..88cef41f 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index f2ef8392..7d4eeac6 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 2f89c883..8aa850f5 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 @@ -34,6 +34,15 @@ spring-boot-maven-plugin ${spring-boot.version} + + fat-jar + + repackage + + + exec + + repackage diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 8068f3ba..017c3d44 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 78f3b868..8a8381a3 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index c3161e11..1e7b7853 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 76d0fbf8..2c5bffc6 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.1 4.0.0 From 3b83f8149c99c15edea7285cf287419525d230b1 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 2 Oct 2023 13:35:08 +0100 Subject: [PATCH 02/37] Changed build process to add exec-jar Added spring-maven dependency execution for fat-jar Added maven-version plugin Updated to version 1.1.1 --- sts-example/pom.xml | 7 +------ sts-secret-server/pom.xml | 6 ------ sts-service-component-example/pom.xml | 5 ----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 868d39a6..ff4cb00a 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -32,7 +32,7 @@ org.springframework.boot - spring-boot-maven-plugin + spring-boot-maven-plugin ${spring-boot.version} @@ -44,11 +44,6 @@ exec - - - repackage - - diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index d49087ee..9239683b 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -195,12 +195,6 @@ build-info - - repackage - - repackage - - diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 8aa850f5..3f74db99 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -43,11 +43,6 @@ exec - - - repackage - - From ee4c97cdb01454b96aebda602a7fcdfe77ba6a79 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 23 Oct 2023 12:34:51 +0100 Subject: [PATCH 03/37] Updated profiles to fix profile including error --- sts-persistence-jpa/src/main/resources/application-h2.yml | 3 --- sts-persistence-jpa/src/main/resources/application-jpa.yml | 4 ++++ sts-persistence-jpa/src/main/resources/application-mysql.yml | 4 ---- .../src/main/resources/application-postgres.yml | 4 ---- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sts-persistence-jpa/src/main/resources/application-h2.yml b/sts-persistence-jpa/src/main/resources/application-h2.yml index 956c8398..628a77d1 100644 --- a/sts-persistence-jpa/src/main/resources/application-h2.yml +++ b/sts-persistence-jpa/src/main/resources/application-h2.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: false change-log: classpath:db/migration/liquibase/changelog.yml diff --git a/sts-persistence-jpa/src/main/resources/application-jpa.yml b/sts-persistence-jpa/src/main/resources/application-jpa.yml index 8e7015d2..ab4d28ed 100644 --- a/sts-persistence-jpa/src/main/resources/application-jpa.yml +++ b/sts-persistence-jpa/src/main/resources/application-jpa.yml @@ -1,4 +1,8 @@ spring: + config: + activate: + on-cloud-platform: "kubernetes" + on-profile: "postgres | mysql | h2" jpa: open-in-view: false hibernate: diff --git a/sts-persistence-jpa/src/main/resources/application-mysql.yml b/sts-persistence-jpa/src/main/resources/application-mysql.yml index 2fe53b4d..0de610c1 100644 --- a/sts-persistence-jpa/src/main/resources/application-mysql.yml +++ b/sts-persistence-jpa/src/main/resources/application-mysql.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: sts @@ -13,4 +10,3 @@ spring: url: jdbc:mysql://localhost:3306/sts jpa: database-platform: org.hibernate.dialect.MySQLInnoDBDialect - hibernate.use-new-id-generator-mappings: false diff --git a/sts-persistence-jpa/src/main/resources/application-postgres.yml b/sts-persistence-jpa/src/main/resources/application-postgres.yml index 7683d818..9f40fe44 100644 --- a/sts-persistence-jpa/src/main/resources/application-postgres.yml +++ b/sts-persistence-jpa/src/main/resources/application-postgres.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: sts @@ -14,4 +11,3 @@ spring: jpa: show-sql: false database-platform: org.hibernate.dialect.PostgreSQL94Dialect - properties.hibernate.temp.use_jdbc_metadata_defaults: false From db09219c9e5ea60b29920ab1977c131480aaf6ad Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 23 Oct 2023 13:03:29 +0100 Subject: [PATCH 04/37] Added possible postgres config for example application --- postgres.docker-compose.yml | 6 +++--- sts-example/pom.xml | 7 ++++++- .../de/adorsys/sts/example/config/StsConfiguration.java | 7 +------ sts-example/src/main/resources/application.yml | 7 +++++++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/postgres.docker-compose.yml b/postgres.docker-compose.yml index 5c646fe7..61337cff 100644 --- a/postgres.docker-compose.yml +++ b/postgres.docker-compose.yml @@ -45,7 +45,7 @@ services: - SPRING_PROFILES_INCLUDE=debug command: config-cli sts-db: - image: postgres:9.6-alpine + image: postgres:latest container_name: sts_db environment: POSTGRES_USER: db_user @@ -55,8 +55,8 @@ services: - "./.docker/sts-db/postgres:/var/lib/postgresql/data" ports: - 5432:5432 - networks: - - sts_network +# networks: +# - sts_network sts: build: ./sts-example image: "local/sts-example:latest" diff --git a/sts-example/pom.xml b/sts-example/pom.xml index ff4cb00a..ceecc5ad 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -25,6 +25,11 @@ de.adorsys.sts sts-persistence-mongo + + org.hibernate.validator + hibernate-validator + 8.0.0.Final + @@ -32,7 +37,7 @@ org.springframework.boot - spring-boot-maven-plugin + spring-boot-maven-plugin ${spring-boot.version} diff --git a/sts-example/src/main/java/de/adorsys/sts/example/config/StsConfiguration.java b/sts-example/src/main/java/de/adorsys/sts/example/config/StsConfiguration.java index f71c23d0..230d4680 100644 --- a/sts-example/src/main/java/de/adorsys/sts/example/config/StsConfiguration.java +++ b/sts-example/src/main/java/de/adorsys/sts/example/config/StsConfiguration.java @@ -17,16 +17,11 @@ @EnableResourceServerInitialization @EnableEncryption @EnablePOP -@EnableKeyRotation +//@EnableKeyRotation @EnableTokenAuthentication @EnableSecretServerClient public class StsConfiguration { - @Bean - public TaskScheduler taskExecutor() { - return new ConcurrentTaskScheduler(); - } - @Bean ResourceServerRepository resourceServerRepository() { return new InMemoryResourceServerRepository(); diff --git a/sts-example/src/main/resources/application.yml b/sts-example/src/main/resources/application.yml index 3281b072..8f4e76e6 100644 --- a/sts-example/src/main/resources/application.yml +++ b/sts-example/src/main/resources/application.yml @@ -21,6 +21,13 @@ spring: default-schema: public sts: + secret-server-client: + audience: moped-client + secret-server-uri: http://localhost:8885/secret-server/token-exchange + cache: + enabled: true + maximum-size: 1000 + expire-after-access: 10 resource-server-management: resource-retriever: http-connect-timeout: 10000 From 0d39190ba965e85dea2eb2ef23661978cd219537 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 23 Oct 2023 13:49:32 +0100 Subject: [PATCH 05/37] Added possible postgres config for example application New version 1.1.2 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 32394735..94596a5c 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.2 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index ddf85c09..a7df4784 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.2 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 9fec8b2c..a3a25988 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.0 + 1.1.2 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index c2c7fa59..8a379927 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index d5499401..9d3df0b0 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index a2da82a1..92b5f672 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 8d291e40..37daa971 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.0 + 1.1.2 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index ba3b7f96..cf3d1857 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 1cb0fd8e..820f4c10 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index feebc19a..331e7d86 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 68c9e19a..7f7faa34 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 8849e3e8..fe0dc042 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index b3af18d7..0f6eb5ab 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index f2ef8392..3c1674a4 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 2f89c883..492f02b6 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 8068f3ba..f0dfdb05 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 78f3b868..8ff5b00d 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index c3161e11..2ca183b9 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 76d0fbf8..9f436f35 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.0 + 1.1.2 4.0.0 From 411d66ed5a48edab222b83d18b6b3fc349cd131d Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 23 Oct 2023 13:51:34 +0100 Subject: [PATCH 06/37] Added possible postgres config for example application New version 1.1.2 --- sts-persistence-jpa/src/main/resources/application-h2.yml | 3 --- sts-persistence-jpa/src/main/resources/application-jpa.yml | 4 ++++ sts-persistence-jpa/src/main/resources/application-mysql.yml | 4 ---- .../src/main/resources/application-postgres.yml | 4 ---- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sts-persistence-jpa/src/main/resources/application-h2.yml b/sts-persistence-jpa/src/main/resources/application-h2.yml index 956c8398..628a77d1 100644 --- a/sts-persistence-jpa/src/main/resources/application-h2.yml +++ b/sts-persistence-jpa/src/main/resources/application-h2.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: false change-log: classpath:db/migration/liquibase/changelog.yml diff --git a/sts-persistence-jpa/src/main/resources/application-jpa.yml b/sts-persistence-jpa/src/main/resources/application-jpa.yml index 8e7015d2..ab4d28ed 100644 --- a/sts-persistence-jpa/src/main/resources/application-jpa.yml +++ b/sts-persistence-jpa/src/main/resources/application-jpa.yml @@ -1,4 +1,8 @@ spring: + config: + activate: + on-cloud-platform: "kubernetes" + on-profile: "postgres | mysql | h2" jpa: open-in-view: false hibernate: diff --git a/sts-persistence-jpa/src/main/resources/application-mysql.yml b/sts-persistence-jpa/src/main/resources/application-mysql.yml index 2fe53b4d..0de610c1 100644 --- a/sts-persistence-jpa/src/main/resources/application-mysql.yml +++ b/sts-persistence-jpa/src/main/resources/application-mysql.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: sts @@ -13,4 +10,3 @@ spring: url: jdbc:mysql://localhost:3306/sts jpa: database-platform: org.hibernate.dialect.MySQLInnoDBDialect - hibernate.use-new-id-generator-mappings: false diff --git a/sts-persistence-jpa/src/main/resources/application-postgres.yml b/sts-persistence-jpa/src/main/resources/application-postgres.yml index 7683d818..9f40fe44 100644 --- a/sts-persistence-jpa/src/main/resources/application-postgres.yml +++ b/sts-persistence-jpa/src/main/resources/application-postgres.yml @@ -1,7 +1,4 @@ spring: - profiles: - include: jpa - liquibase: default-schema: sts @@ -14,4 +11,3 @@ spring: jpa: show-sql: false database-platform: org.hibernate.dialect.PostgreSQL94Dialect - properties.hibernate.temp.use_jdbc_metadata_defaults: false From 7e4d7ff0366b34c97856328a3158248c5857197e Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 24 Oct 2023 11:32:42 +0100 Subject: [PATCH 07/37] Added possible postgres config for example application New version 1.1.2 --- sts-example/pom.xml | 7 ++++--- sts-secret-server/pom.xml | 6 +++--- sts-service-component-example/pom.xml | 7 ++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 8a379927..0a031f61 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -36,9 +36,10 @@ ${spring-boot.version} - - repackage - + repackage + + exec + diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index fe0dc042..28d3785d 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -188,9 +188,9 @@ repackage - - repackage - + + exec + diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 492f02b6..99a98d5f 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -35,9 +35,10 @@ ${spring-boot.version} - - repackage - + repackage + + exec + From 7e1b6e1ed48828160a4264a5a2e6b24bbffcd565 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 24 Oct 2023 11:37:53 +0100 Subject: [PATCH 08/37] Added possible postgres config for example application New version 1.1.2 Added missing classifier --- sts-common/pom.xml | 11 +++++++++++ sts-example/pom.xml | 5 ++++- sts-secret-server/pom.xml | 5 ++++- sts-service-component-example/pom.xml | 5 ++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/sts-common/pom.xml b/sts-common/pom.xml index a3a25988..5f0c208c 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -94,6 +94,17 @@ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10022 + + + fat-jar + + repackage + + + exec + + + diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 0a031f61..b3d59d54 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -36,7 +36,10 @@ ${spring-boot.version} - repackage + fat-jar + + repackage + exec diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 28d3785d..1039a197 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -187,7 +187,10 @@ - repackage + fat-jar + + repackage + exec diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 99a98d5f..b83e2652 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -35,7 +35,10 @@ ${spring-boot.version} - repackage + fat-jar + + repackage + exec From 7be882f087f35ca7be221d315800a3ed9ad377af Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 24 Oct 2023 11:38:24 +0100 Subject: [PATCH 09/37] Added possible postgres config for example application New version 1.1.3 Added missing classifier --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 94596a5c..fd9e88c6 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.2 + 1.1.3 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index a7df4784..ba359255 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.2 + 1.1.3 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 5f0c208c..2c60523b 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.2 + 1.1.3 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index b3d59d54..eec7d854 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 9d3df0b0..b747ce6e 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 92b5f672..9b218778 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 37daa971..9cfd0aa1 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.2 + 1.1.3 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index cf3d1857..ad2e5877 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 820f4c10..91bc0192 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 331e7d86..b97f172c 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 7f7faa34..37f8fa45 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 1039a197..94fdabf1 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 0f6eb5ab..b605b240 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 3c1674a4..be2e2279 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index b83e2652..5eef15f1 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index f0dfdb05..1bf9c75d 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 8ff5b00d..b5c88dff 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 2ca183b9..003f16c3 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 9f436f35..14d865e4 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.2 + 1.1.3 4.0.0 From ce0695e15ad60a0cf57c3dfcb4276885ee8c6e2e Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Thu, 26 Oct 2023 11:13:50 +0100 Subject: [PATCH 10/37] Changed implementation of KeyRotationServiceImpl.java to anonymous implementation because there is an error with the typeresolver due to old java 6 dependency --- .../service/KeyRotationServiceImpl.java | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/service/KeyRotationServiceImpl.java b/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/service/KeyRotationServiceImpl.java index b601fc11..541928a2 100644 --- a/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/service/KeyRotationServiceImpl.java +++ b/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/service/KeyRotationServiceImpl.java @@ -2,8 +2,10 @@ import com.google.common.collect.Streams; import com.googlecode.cqengine.attribute.Attribute; +import com.googlecode.cqengine.attribute.SimpleAttribute; import com.googlecode.cqengine.attribute.support.SimpleFunction; import com.googlecode.cqengine.query.Query; +import com.googlecode.cqengine.query.option.QueryOptions; import de.adorsys.keymanagement.api.types.ResultCollection; import de.adorsys.keymanagement.api.types.entity.KeyAlias; import de.adorsys.keymanagement.api.types.entity.KeyEntry; @@ -24,11 +26,42 @@ public class KeyRotationServiceImpl implements KeyRotationService { private final SimpleFunction STS = it -> ((StsKeyEntry) it.getMeta()); - private final Attribute STATE = attribute(it -> STS.apply(it).getState()); - private final Attribute NOT_BEFORE = attribute(it -> STS.apply(it).getNotBefore().toInstant()); - private final Attribute NOT_AFTER = attribute(it -> STS.apply(it).getNotAfter().toInstant()); - private final Attribute EXPIRE_AT = attribute(it -> STS.apply(it).getExpireAt().toInstant()); - private final Attribute USAGE = attribute(it -> STS.apply(it).getKeyUsage()); + + private final Attribute STATE = new SimpleAttribute<>() { + @Override + public KeyState getValue(KeyEntry o, QueryOptions queryOptions) { + return STS.apply(o).getState(); + } + }; + + private final Attribute NOT_BEFORE = new SimpleAttribute<>() { + @Override + public Instant getValue(KeyEntry o, QueryOptions queryOptions) { + return STS.apply(o).getNotBefore().toInstant(); + } + }; + + private final Attribute NOT_AFTER = new SimpleAttribute<>() { + @Override + public Instant getValue(KeyEntry o, QueryOptions queryOptions) { + return STS.apply(o).getNotAfter().toInstant(); + } + }; + + private final Attribute EXPIRE_AT = new SimpleAttribute<>() { + @Override + public Instant getValue(KeyEntry o, QueryOptions queryOptions) { + return STS.apply(o).getExpireAt().toInstant(); + } + }; + + private final Attribute USAGE = new SimpleAttribute<>() { + @Override + public KeyUsage getValue(KeyEntry o, QueryOptions queryOptions) { + return STS.apply(o).getKeyUsage(); + } + }; + private final KeyStoreGenerator keyStoreGenerator; private final Clock clock; From 7cd0c6823c311a78bc5e104729ebd11701faf868 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Thu, 26 Oct 2023 11:20:35 +0100 Subject: [PATCH 11/37] Update sts version to 1.1.4 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index fd9e88c6..f68cc52d 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.3 + 1.1.4 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index ba359255..d77839ca 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.3 + 1.1.4 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 2c60523b..54cbee08 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.3 + 1.1.4 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index eec7d854..52cc7edb 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index b747ce6e..3b01f216 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 9b218778..4e451c48 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 9cfd0aa1..9fce9965 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.3 + 1.1.4 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index ad2e5877..300e96db 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 91bc0192..2fa21a8e 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index b97f172c..79fd6c44 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 37f8fa45..25afd961 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 94fdabf1..74295694 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index b605b240..d715ff05 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index be2e2279..3b91aa99 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 5eef15f1..36bf49ed 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 1bf9c75d..b0dbf977 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index b5c88dff..5b4784df 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 003f16c3..850ca0d5 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 14d865e4..95f3f3cf 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.3 + 1.1.4 4.0.0 From 6cdc439a49da3cadc508b4052eb4b2c68f106724 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Thu, 26 Oct 2023 12:16:31 +0100 Subject: [PATCH 12/37] New version of keymanagement --- pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 2 +- sts-spring/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d77839ca..ddd70538 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ UTF-8 UTF-8 3.0.6 - 0.0.7 + 0.0.8 5.3.0 3.0.0 2.15.1 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 4e451c48..5d7ffe01 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -30,7 +30,7 @@ de.adorsys.keymanagement api - 0.0.7 + 0.0.8 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 9fce9965..eeaf2e11 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -23,7 +23,7 @@ de.adorsys.keymanagement core - 0.0.7 + 0.0.8 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 5b4784df..69a6de24 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -61,7 +61,7 @@ de.adorsys.keymanagement juggler-bouncycastle - 0.0.7 + 0.0.8 From 1530bf171e89bbcde9743c9912391dae9924f467 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Thu, 26 Oct 2023 12:17:22 +0100 Subject: [PATCH 13/37] New version of keymanagement --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index f68cc52d..79ab54f7 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.4 + 1.1.5 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index ddd70538..e303b0c7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.4 + 1.1.5 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 54cbee08..cea9d436 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.4 + 1.1.5 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 52cc7edb..6feb037c 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 3b01f216..c786f28f 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 5d7ffe01..eccc4de2 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index eeaf2e11..cc679d29 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.4 + 1.1.5 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 300e96db..15ed6e41 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 2fa21a8e..5e031cb7 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 79fd6c44..03e3430e 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 25afd961..38e29200 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 74295694..bfa671c7 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index d715ff05..8f38186c 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 3b91aa99..3cfaa56d 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 36bf49ed..38f5d747 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index b0dbf977..5f899b31 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 69a6de24..fa647b85 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 850ca0d5..fb033819 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 95f3f3cf..42d66d72 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.4 + 1.1.5 4.0.0 From 030de1c3a661a5ba75360d65e6a92e842f25d703 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 30 Oct 2023 11:37:50 +0000 Subject: [PATCH 14/37] New version of keymanagement --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 9 ++++++--- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 4 ++-- sts-keymanagement/sts-keymanagement-impl/pom.xml | 8 ++++---- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 4 ++-- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 29 insertions(+), 26 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 79ab54f7..4e3fa102 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.5 + 1.1.6 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index e303b0c7..56ec0f10 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.5 + 1.1.6 pom SecureTokenService @@ -52,7 +52,7 @@ UTF-8 UTF-8 3.0.6 - 0.0.8 + 0.0.9 5.3.0 3.0.0 2.15.1 @@ -544,7 +544,10 @@ sonatype https://oss.sonatype.org/ - true + false + true + true + 10 diff --git a/sts-common/pom.xml b/sts-common/pom.xml index cea9d436..55913da3 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.5 + 1.1.6 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 6feb037c..3a442ca8 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index c786f28f..fb5b47ec 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index eccc4de2..c7f2c3f0 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 @@ -30,7 +30,7 @@ de.adorsys.keymanagement api - 0.0.8 + 0.0.9 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index cc679d29..3be9bcfe 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.5 + 1.1.6 de.adorsys.sts @@ -23,7 +23,7 @@ de.adorsys.keymanagement core - 0.0.8 + 0.0.9 @@ -50,7 +50,7 @@ de.adorsys.keymanagement juggler-bouncycastle - 0.0.7 + 0.0.9 test diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 15ed6e41..882a1b2c 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 5e031cb7..777d0ec5 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 03e3430e..1ae0efc0 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 38e29200..afb7245e 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index bfa671c7..c302eabf 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 8f38186c..0f20aae0 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 3cfaa56d..a0e97cb8 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 38f5d747..f03445c7 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 5f899b31..ff879e75 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index fa647b85..d314ca00 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 @@ -61,7 +61,7 @@ de.adorsys.keymanagement juggler-bouncycastle - 0.0.8 + 0.0.9 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index fb033819..4c9795b9 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 42d66d72..cb933dfc 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.5 + 1.1.6 4.0.0 From 0b33d64ff14817ce9df5b70567a24d3a57df8c1a Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 30 Oct 2023 11:45:19 +0000 Subject: [PATCH 15/37] New version of keymanagement --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 4e3fa102..6afba920 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.6 + 1.1.7 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 56ec0f10..54716781 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.6 + 1.1.7 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 55913da3..cdf59ac1 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.6 + 1.1.7 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 3a442ca8..8fa0820b 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index fb5b47ec..045e93b2 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index c7f2c3f0..3ca6cb6d 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 3be9bcfe..41ece4c5 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.6 + 1.1.7 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 882a1b2c..51d94f54 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 777d0ec5..cbe6d7fc 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 1ae0efc0..c848e238 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index afb7245e..a8b217e4 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index c302eabf..8e968d3c 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 0f20aae0..bf779dd4 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index a0e97cb8..0c2495f1 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index f03445c7..9391869b 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index ff879e75..d4988c04 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index d314ca00..729a5800 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 4c9795b9..f9c9e0cb 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index cb933dfc..fe98e897 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.6 + 1.1.7 4.0.0 From 690dc8694f1abf80739f80e9f9bf8c67e22fa927 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 31 Oct 2023 14:52:43 +0000 Subject: [PATCH 16/37] Increased release timeout --- pom.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 54716781..ec8b4134 100644 --- a/pom.xml +++ b/pom.xml @@ -544,10 +544,9 @@ sonatype https://oss.sonatype.org/ - false - true + true true - 10 + 30 From 81ef523d89f9e3fe2f0e5947b77d9610360a0b95 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 31 Oct 2023 14:53:00 +0000 Subject: [PATCH 17/37] Fixed Json parsing Bug in PopController#getPublicKeys --- .../java/de/adorsys/sts/pop/PopController.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sts-spring/src/main/java/de/adorsys/sts/pop/PopController.java b/sts-spring/src/main/java/de/adorsys/sts/pop/PopController.java index 8c55b24b..48601eba 100644 --- a/sts-spring/src/main/java/de/adorsys/sts/pop/PopController.java +++ b/sts-spring/src/main/java/de/adorsys/sts/pop/PopController.java @@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Map; + @RestController @Api(value = "/pop", tags = {"Proof of Possession RFC7800"}, description = "Public key distribution endpoint") @RequestMapping("/pop") @@ -38,15 +40,11 @@ public PopController(PopService popService) { @ApiResponses(value = {@ApiResponse(code = 200, message = "Ok")}) public ResponseEntity getPublicKeys() { JWKSet publicKeys = popService.getPublicKeys(); + ObjectMapper mapper = new ObjectMapper(); - JsonNode jsonObject = null; - try { - jsonObject = mapper.readTree(publicKeys.toJSONObject().toString()); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } - -// return response entity - return ResponseEntity.ok(jsonObject.toString()); + Map jsonObject = publicKeys.toJSONObject(); + JsonNode jsonNode = mapper.convertValue(jsonObject, JsonNode.class); + + return ResponseEntity.ok(jsonNode.toString()); } } From b2f9f8d4c9297a062dae5c9a0b571ecae735b5e3 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 31 Oct 2023 14:53:41 +0000 Subject: [PATCH 18/37] Increased version to 1.1.8 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 6afba920..cb53cd78 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.7 + 1.1.8 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index ec8b4134..7b5f75c9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.7 + 1.1.8 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index cdf59ac1..1cfc4cd9 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.7 + 1.1.8 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 8fa0820b..a5076abf 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 045e93b2..d1311458 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 3ca6cb6d..2a1f0977 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 41ece4c5..b85df798 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.7 + 1.1.8 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 51d94f54..957799ef 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index cbe6d7fc..64fe1541 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index c848e238..6cb49a17 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index a8b217e4..91461ffb 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 8e968d3c..41c96317 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index bf779dd4..8fb559c4 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 0c2495f1..b1dcc2d7 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 9391869b..93fd06e3 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index d4988c04..d8532fb3 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 729a5800..a1bb36a6 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index f9c9e0cb..db3845d0 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index fe98e897..1555cf89 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.7 + 1.1.8 4.0.0 From 176c40f35671f9b75cd9416485448843064ee805 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 6 Nov 2023 11:49:51 +0000 Subject: [PATCH 19/37] Fixed json parser bug because of unneccessary toString(); --- .../TokenExchangeSecretServerClient.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sts-token/src/main/java/de/adorsys/sts/token/secretserver/TokenExchangeSecretServerClient.java b/sts-token/src/main/java/de/adorsys/sts/token/secretserver/TokenExchangeSecretServerClient.java index 6d835272..d2597534 100644 --- a/sts-token/src/main/java/de/adorsys/sts/token/secretserver/TokenExchangeSecretServerClient.java +++ b/sts-token/src/main/java/de/adorsys/sts/token/secretserver/TokenExchangeSecretServerClient.java @@ -1,6 +1,5 @@ package de.adorsys.sts.token.secretserver; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import de.adorsys.sts.keymanagement.service.DecryptionService; @@ -11,6 +10,8 @@ import de.adorsys.sts.tokenauth.BearerToken; import de.adorsys.sts.tokenauth.BearerTokenValidator; +import java.util.Map; + public class TokenExchangeSecretServerClient implements SecretServerClient { private final String audience; @@ -43,15 +44,10 @@ public String getSecret(String token) { throw new IllegalArgumentException("Exchanged token is invalid"); } - ObjectMapper mapper = new ObjectMapper(); - JsonNode claims = null; - try { - claims = mapper.readTree(bearerToken.getClaims().toJSONObject().toString()); - } catch (JsonProcessingException e) { - throw new RuntimeException(e); - } + Map jsonObject = bearerToken.getClaims().toJSONObject(); + JsonNode claims = mapper.convertValue(jsonObject, JsonNode.class); JsonNode encryptedSecrets = claims.get(TokenExchangeConstants.SECRETS_CLAIM_KEY); From f3a00abe1531b8c63bf220fbdcfb002e42eb9da6 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 6 Nov 2023 11:51:05 +0000 Subject: [PATCH 20/37] Increased version to 1.1.9 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index cb53cd78..46c09a2d 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.8 + 1.1.9 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 7b5f75c9..6dd32f3f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.8 + 1.1.9 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 1cfc4cd9..319c222d 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.8 + 1.1.9 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index a5076abf..932f55e0 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index d1311458..bacb6d92 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 2a1f0977..d3431a40 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index b85df798..18780765 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.8 + 1.1.9 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 957799ef..dcee7788 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 64fe1541..bd844897 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 6cb49a17..fdf93938 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 91461ffb..5a9b43f4 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 41c96317..cc0229af 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 8fb559c4..1340cb52 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index b1dcc2d7..7d76ab8c 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 93fd06e3..9e4b0272 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index d8532fb3..18e5c485 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index a1bb36a6..412c8f27 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index db3845d0..31002edb 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 1555cf89..9a5bfbc7 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.8 + 1.1.9 4.0.0 From 54f0ff5c0a5a02f2d2348cce1ce5334bdd29db40 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 13 Nov 2023 10:40:25 -0100 Subject: [PATCH 21/37] Made CorsFilter Policy configurable because of IllegalStateException due to miss configuration --- .../secretserver/configuration/CorsProperties.java | 14 ++++++++++++++ .../configuration/SecurityConfiguration.java | 11 +++++++---- .../src/main/resources/application-dev.yml | 5 +++++ .../src/main/resources/application.yml | 5 +++++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java new file mode 100644 index 00000000..7370c03b --- /dev/null +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java @@ -0,0 +1,14 @@ +package de.adorsys.sts.secretserver.configuration; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConfigurationProperties(prefix = "cors") +@Data +public class CorsProperties { + private String[] allowedOrigins; + private String allowedHeaders; + private String[] allowedMethods; +} \ No newline at end of file diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java index c44f362b..00eca4d5 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java @@ -15,6 +15,8 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; +import java.util.Arrays; + @Configuration @EnableWebSecurity public class SecurityConfiguration { @@ -42,12 +44,12 @@ protected SecurityFilterChain securityFilterChain(HttpSecurity http, TokenAuthen } @Bean - public CorsFilter corsFilter() { + public CorsFilter corsFilter(CorsProperties corsProperties) { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); - config.addAllowedOrigin("*"); - config.addAllowedHeader("*"); - config.addAllowedMethod("*"); + Arrays.stream(corsProperties.getAllowedOrigins()).forEach(config::addAllowedOrigin); + config.addAllowedHeader(corsProperties.getAllowedHeaders()); + Arrays.stream(corsProperties.getAllowedMethods()).forEach(config::addAllowedMethod); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", config); @@ -55,6 +57,7 @@ public CorsFilter corsFilter() { return new CorsFilter(source); } + @Bean public WebSecurityCustomizer customize() { return (web) -> web.ignoring().requestMatchers( diff --git a/sts-secret-server/src/main/resources/application-dev.yml b/sts-secret-server/src/main/resources/application-dev.yml index fb4f7583..9898c700 100644 --- a/sts-secret-server/src/main/resources/application-dev.yml +++ b/sts-secret-server/src/main/resources/application-dev.yml @@ -11,6 +11,11 @@ spring: jpa: show-sql: false +cors: + allowedOrigins: "*" + allowedHeaders: "*" + allowedMethods: GET,POST,PUT,DELETE + sts: secret-server: secret-length: 8192 diff --git a/sts-secret-server/src/main/resources/application.yml b/sts-secret-server/src/main/resources/application.yml index 0f47cb13..2a8f657e 100644 --- a/sts-secret-server/src/main/resources/application.yml +++ b/sts-secret-server/src/main/resources/application.yml @@ -26,6 +26,11 @@ spring: - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration - org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration +cors: + allowedOrigins: "*" + allowedHeaders: "*" + allowedMethods: GET,POST,PUT,DELETE + sts: secret: secret-length: 2048 From 2d5ec63b10fc99dbad3e8efd56e5447cc9831d25 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 13 Nov 2023 10:41:32 -0100 Subject: [PATCH 22/37] Increased version to 1.1.10 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 46c09a2d..953abb04 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.9 + 1.1.10 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 6dd32f3f..477880cd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.9 + 1.1.10 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 319c222d..e31c1bcd 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.9 + 1.1.10 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 932f55e0..c9b50be6 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index bacb6d92..4667e7a5 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index d3431a40..53569c8b 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 18780765..7080fac8 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.9 + 1.1.10 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index dcee7788..8333a8ed 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index bd844897..bd8944d5 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index fdf93938..4baaf562 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 5a9b43f4..ad57dc5b 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index cc0229af..8bdd7f46 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 1340cb52..e31dd13d 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 7d76ab8c..9ba67b53 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 9e4b0272..d495674d 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 18e5c485..4d23d320 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 412c8f27..2426e3ef 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 31002edb..3db4f389 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 9a5bfbc7..2981b0ac 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.9 + 1.1.10 4.0.0 From 58cd702be7c56a599a1eb7851cc300bdd0e8a5c3 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 13 Nov 2023 11:18:31 -0100 Subject: [PATCH 23/37] Increased version to 1.1.11 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 7 ++++++- sts-token/pom.xml | 2 +- 19 files changed, 25 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 953abb04..86fd3ecd 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.10 + 1.1.11 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 477880cd..55fc011e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.10 + 1.1.11 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index e31c1bcd..88ddd274 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.10 + 1.1.11 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index c9b50be6..e1317d9d 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 4667e7a5..297c977d 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 53569c8b..15302b8f 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 7080fac8..867ac34c 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.10 + 1.1.11 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 8333a8ed..9a494756 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index bd8944d5..58f7f7e3 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 4baaf562..41ff28d2 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index ad57dc5b..ec95c71b 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 8bdd7f46..b7ff16c1 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index e31dd13d..13a95095 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 9ba67b53..ce260726 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index d495674d..c20b603d 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 4d23d320..d6847040 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 2426e3ef..f3865714 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 3db4f389..f41f2b7c 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 @@ -33,5 +33,10 @@ org.apache.commons commons-lang3 + + backport-util-concurrent + backport-util-concurrent + 3.1 + diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 2981b0ac..19036a8a 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.10 + 1.1.11 4.0.0 From 6cd5386c71f176a0d07e14f7dadfbcdfb7997c39 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 13 Nov 2023 11:18:47 -0100 Subject: [PATCH 24/37] Made jwk cacheable in AuthServer --- .../de/adorsys/sts/tokenauth/AuthServer.java | 86 +++++++------------ 1 file changed, 33 insertions(+), 53 deletions(-) diff --git a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java index 671ff49d..aa023767 100644 --- a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java +++ b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java @@ -1,27 +1,28 @@ package de.adorsys.sts.tokenauth; import com.nimbusds.jose.JOSEException; -import com.nimbusds.jose.KeySourceException; import com.nimbusds.jose.jwk.*; import com.nimbusds.jose.jwk.source.JWKSource; import com.nimbusds.jose.jwk.source.RemoteJWKSet; import com.nimbusds.jose.proc.SecurityContext; -import org.apache.commons.lang3.time.DateUtils; +import lombok.Getter; -import java.net.MalformedURLException; import java.net.URL; import java.security.Key; import java.util.Date; import java.util.List; +import java.util.concurrent.ConcurrentHashMap; public class AuthServer { + @Getter private String name; - private String issUrl; - private String jwksUrl; + @Getter + private final String issUrl; + private final String jwksUrl; private int refreshIntervalSeconds = 600; - private Date refreshExp = null; - private JWKSource jwkSource = null; + private final ConcurrentHashMap jwkCache = new ConcurrentHashMap<>(); + private long lastCacheUpdate = 0; public AuthServer(String name, String issUrl, String jwksUrl) { super(); @@ -38,30 +39,37 @@ public AuthServer(String name, String issUrl, String jwksUrl, int refreshInterva this.refreshIntervalSeconds = refreshIntervalSeconds; } + private void updateJwkCache() throws JsonWebKeyRetrievalException { + try { + JWKSource jwkSource = new RemoteJWKSet<>(new URL(this.jwksUrl)); + List jwks = jwkSource.get(new JWKSelector(new JWKMatcher.Builder().build()), null); + onJsonWebKeySetRetrieved(jwks); + + // Update the cache + jwkCache.clear(); + for (JWK jwk : jwks) { + jwkCache.put(jwk.getKeyID(), jwk); + } + lastCacheUpdate = new Date().getTime(); + } catch (Exception e) { + throw new JsonWebKeyRetrievalException(e); + } + } + public Key getJWK(String keyID) throws JsonWebKeyRetrievalException { Date now = new Date(); - if (refreshExp == null || now.after(refreshExp)) { - refreshExp = DateUtils.addSeconds(now, refreshIntervalSeconds); + long currentTime = now.getTime(); - try { - jwkSource = new RemoteJWKSet<>(new URL(this.jwksUrl)); - } catch (MalformedURLException e) { - throw new JsonWebKeyRetrievalException(e); - } + // Check if the cache is still valid + if (currentTime - lastCacheUpdate > refreshIntervalSeconds * 1000L || jwkCache.isEmpty()) { + updateJwkCache(); } - JWKSelector jwkSelector = new JWKSelector(new JWKMatcher.Builder().keyID(keyID).build()); - List list; - try { - list = jwkSource.get(jwkSelector, null); - onJsonWebKeySetRetrieved(list); - } catch (KeySourceException e) { - throw new JsonWebKeyRetrievalException(e); + JWK jwk = jwkCache.get(keyID); + if (jwk == null) { + throw new JsonWebKeyRetrievalException("Key with ID " + keyID + " not found in cache"); } - if (list.isEmpty()) throw new JsonWebKeyRetrievalException("Unable to retrieve keys: received JWKSet is empty"); - - JWK jwk = list.iterator().next(); if (jwk instanceof RSAKey) { try { return ((RSAKey) jwk).toPublicKey(); @@ -75,42 +83,14 @@ public Key getJWK(String keyID) throws JsonWebKeyRetrievalException { } } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } - public String getIssUrl() { - return issUrl; - } - - public void setIssUrl(String issUrl) { - this.issUrl = issUrl; - } - - public String getJwksUrl() { - return jwksUrl; - } - - public void setJwksUrl(String jwksUrl) { - this.jwksUrl = jwksUrl; - } - - public int getRefreshIntervalSeconds() { - return refreshIntervalSeconds; - } - - public void setRefreshIntervalSeconds(int refreshIntervalSeconds) { - this.refreshIntervalSeconds = refreshIntervalSeconds; - } - protected void onJsonWebKeySetRetrieved(List jwks) { } - public class JsonWebKeyRetrievalException extends RuntimeException { + public static class JsonWebKeyRetrievalException extends RuntimeException { public JsonWebKeyRetrievalException(Throwable cause) { super(cause); } From 6501c6bdf596dee7417a22877c7867a30466e85b Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Mon, 13 Nov 2023 11:19:17 -0100 Subject: [PATCH 25/37] Increased version to 1.1.12 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 86fd3ecd..aef86d93 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.11 + 1.1.12 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 55fc011e..c08a6881 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.11 + 1.1.12 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 88ddd274..2c1dc8fe 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.11 + 1.1.12 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index e1317d9d..4acda361 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 297c977d..bdfb9221 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 15302b8f..237ae914 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 867ac34c..703fad78 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.11 + 1.1.12 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 9a494756..fd08c436 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 58f7f7e3..8b5686d0 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 41ff28d2..3d9b26be 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index ec95c71b..35d60038 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index b7ff16c1..ebdc50d7 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 13a95095..7ff8515b 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index ce260726..9fc11e5f 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index c20b603d..a391c8f4 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index d6847040..116d3adf 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index f3865714..c4182e1c 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index f41f2b7c..f608b72a 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 19036a8a..4b44fb9e 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.11 + 1.1.12 4.0.0 From bb52557ad9dead6d7efe6ee5505da3f9e86f28f3 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 14 Nov 2023 13:11:05 -0100 Subject: [PATCH 26/37] Increased version of bouncycastle-adapter to 0.0.10 --- pom.xml | 2 +- sts-spring/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c08a6881..988a1e5c 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ UTF-8 UTF-8 3.0.6 - 0.0.9 + 0.0.10 5.3.0 3.0.0 2.15.1 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index c4182e1c..3377735f 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -61,7 +61,7 @@ de.adorsys.keymanagement juggler-bouncycastle - 0.0.9 + 0.0.10 From e3657ae616a703f68257acce919dfe5fa95eaed9 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 14 Nov 2023 13:11:53 -0100 Subject: [PATCH 27/37] Increased version to 1.1.13 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index aef86d93..6bc552bf 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.12 + 1.1.13 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 988a1e5c..d49df1f0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.12 + 1.1.13 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 2c1dc8fe..a375d8c4 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.12 + 1.1.13 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 4acda361..327e174e 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index bdfb9221..ba48b059 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 237ae914..a5f30110 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 703fad78..005bb4a9 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.12 + 1.1.13 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index fd08c436..90e56433 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 8b5686d0..702ed9de 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 3d9b26be..6483baff 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 35d60038..76511657 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index ebdc50d7..b805e709 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 7ff8515b..45095fee 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 9fc11e5f..5c9bd0bb 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index a391c8f4..a68950d3 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 116d3adf..b2f4f0df 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 3377735f..8b21b6e7 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index f608b72a..caa20b48 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 4b44fb9e..c7a9d15f 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.12 + 1.1.13 4.0.0 From ea569e31fea1882d344f15d4ed06b4f63bad19f1 Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Tue, 12 Dec 2023 14:46:37 +0100 Subject: [PATCH 28/37] Added tests for AuthServer to see if cache is working --- postgres.docker-compose.yml | 4 +- .../sts/persistence/jpa/entity/JpaSecret.java | 4 +- .../SecretServerApplicationIT.java | 13 +-- ...igurationPropertiesAuthServerProvider.java | 3 +- .../authentication/LoggingAuthServer.java | 10 +- sts-token-auth/pom.xml | 12 ++ .../de/adorsys/sts/tokenauth/AuthServer.java | 31 +++--- .../adorsys/sts/tokenauth/AuthServerTest.java | 103 ++++++++++++++++++ .../org.mockito.plugins.MockMaker | 1 + 9 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java create mode 100644 sts-token-auth/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/postgres.docker-compose.yml b/postgres.docker-compose.yml index 61337cff..c6ffcec0 100644 --- a/postgres.docker-compose.yml +++ b/postgres.docker-compose.yml @@ -51,8 +51,8 @@ services: POSTGRES_USER: db_user POSTGRES_PASSWORD: db_user@123 POSTGRES_DB: sts - volumes: - - "./.docker/sts-db/postgres:/var/lib/postgresql/data" +# volumes: +# - "./.docker/sts-db/postgres:/var/lib/postgresql/data" ports: - 5432:5432 # networks: diff --git a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java index a5473015..45bc9452 100644 --- a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java +++ b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java @@ -12,8 +12,8 @@ public class JpaSecret { @Id - @GeneratedValue(strategy = GenerationType.AUTO) - private int id; + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; private String subject; diff --git a/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java b/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java index f4d1fe89..9fdb663c 100644 --- a/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java +++ b/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java @@ -15,7 +15,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; @@ -23,8 +22,6 @@ import org.springframework.web.client.DefaultResponseErrorHandler; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RestTemplate; -import org.testcontainers.containers.PostgreSQLContainer; -import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import java.util.Arrays; @@ -95,7 +92,7 @@ void setup() { } -// @Test + @Test void shouldReturnTheSameSecretForSameUser() { String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); String secondSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); @@ -103,7 +100,7 @@ void shouldReturnTheSameSecretForSameUser() { assertThat(firstSecret, is(equalTo(secondSecret))); } - // @Test + @Test void shouldReturnDifferentSecretsForDifferentUsers() throws Exception { String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); String secondSecret = getDecryptedSecret(USERNAME_TWO, PASSWORD_TWO); @@ -111,7 +108,7 @@ void shouldReturnDifferentSecretsForDifferentUsers() throws Exception { assertThat(firstSecret, is(not(equalTo(secondSecret)))); } - // @Test + @Test void shouldNotReturnTheSameTokenForSameUser() throws Exception { TokenResponse firstTokenResponse = getSecretServerToken(USERNAME_ONE, PASSWORD_ONE); assertThat(firstTokenResponse.getAccess_token(), is(notNullValue())); @@ -122,7 +119,7 @@ void shouldNotReturnTheSameTokenForSameUser() throws Exception { assertThat(firstTokenResponse, is(not(equalTo(secondTokenResponse)))); } - // @Test + @Test void shouldNotGetSecretForInvalidAccessToken() throws Exception { final String invalidAccessToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJvVjU2Uk9namthbTVzUmVqdjF6b1JVNmY" + "1R3YtUGRTdjN2b1ZfRVY5MmxnIn0.eyJqdGkiOiI5NWY2MzQ4NC04MTk2LTQ2NzYtYjI4Ni1lYjY4YTFmOTZmYTAiLCJleHAiOjE1N" + @@ -158,7 +155,7 @@ void shouldNotGetSecretForFakeAccessToken() throws Exception { assertThat(((HttpClientErrorException) caughtException).getStatusCode(), is(equalTo(HttpStatus.FORBIDDEN))); } - // @Test + @Test void shouldGetEmptySecretsForUnknownAudience() throws Exception { Authentication.AuthenticationToken authToken = authentication.login(USERNAME_ONE, PASSWORD_ONE); diff --git a/sts-spring/src/main/java/de/adorsys/sts/token/authentication/ConfigurationPropertiesAuthServerProvider.java b/sts-spring/src/main/java/de/adorsys/sts/token/authentication/ConfigurationPropertiesAuthServerProvider.java index c57cfc2c..e50074f5 100644 --- a/sts-spring/src/main/java/de/adorsys/sts/token/authentication/ConfigurationPropertiesAuthServerProvider.java +++ b/sts-spring/src/main/java/de/adorsys/sts/token/authentication/ConfigurationPropertiesAuthServerProvider.java @@ -55,8 +55,7 @@ private AuthServer mapFromProperties(AuthServerConfigurationProperties.AuthServe properties.getName(), properties.getIssUrl(), properties.getJwksUrl(), - properties.getRefreshIntervalSeconds(), - objectMapper + properties.getRefreshIntervalSeconds() ); } } diff --git a/sts-spring/src/main/java/de/adorsys/sts/token/authentication/LoggingAuthServer.java b/sts-spring/src/main/java/de/adorsys/sts/token/authentication/LoggingAuthServer.java index 8295ebc3..6aeebf19 100644 --- a/sts-spring/src/main/java/de/adorsys/sts/token/authentication/LoggingAuthServer.java +++ b/sts-spring/src/main/java/de/adorsys/sts/token/authentication/LoggingAuthServer.java @@ -10,17 +10,9 @@ import java.util.List; public class LoggingAuthServer extends AuthServer { - private static final Logger LOG = LoggerFactory.getLogger(LoggingBearerTokenValidator.class); - private final ObjectMapper objectMapper; - public LoggingAuthServer(String name, String issUrl, String jwksUrl, ObjectMapper objectMapper) { - super(name, issUrl, jwksUrl); - this.objectMapper = objectMapper; - } - - public LoggingAuthServer(String name, String issUrl, String jwksUrl, int refreshIntervalSeconds, ObjectMapper objectMapper) { + public LoggingAuthServer(String name, String issUrl, String jwksUrl, int refreshIntervalSeconds) { super(name, issUrl, jwksUrl, refreshIntervalSeconds); - this.objectMapper = objectMapper; } @Override diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index caa20b48..c922839f 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -38,5 +38,17 @@ backport-util-concurrent 3.1 + + org.junit.jupiter + junit-jupiter-api + 5.10.1 + test + + + + org.mockito + mockito-core + test + diff --git a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java index aa023767..f250344e 100644 --- a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java +++ b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java @@ -3,9 +3,12 @@ import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.*; import com.nimbusds.jose.jwk.source.JWKSource; -import com.nimbusds.jose.jwk.source.RemoteJWKSet; +import com.nimbusds.jose.jwk.source.JWKSourceBuilder; import com.nimbusds.jose.proc.SecurityContext; import lombok.Getter; +import lombok.Setter; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; import java.net.URL; import java.security.Key; @@ -13,35 +16,40 @@ import java.util.List; import java.util.concurrent.ConcurrentHashMap; +@Slf4j public class AuthServer { + @Setter @Getter private String name; @Getter private final String issUrl; private final String jwksUrl; - private int refreshIntervalSeconds = 600; + private final int refreshIntervalSeconds; - private final ConcurrentHashMap jwkCache = new ConcurrentHashMap<>(); - private long lastCacheUpdate = 0; + @Setter + JWKSource jwkSource; + + final ConcurrentHashMap jwkCache = new ConcurrentHashMap<>(); + long lastCacheUpdate = 0; public AuthServer(String name, String issUrl, String jwksUrl) { - super(); - this.name = name; - this.issUrl = issUrl; - this.jwksUrl = jwksUrl; + this(name, issUrl, jwksUrl, 600); } + @SneakyThrows public AuthServer(String name, String issUrl, String jwksUrl, int refreshIntervalSeconds) { super(); this.name = name; this.issUrl = issUrl; this.jwksUrl = jwksUrl; this.refreshIntervalSeconds = refreshIntervalSeconds; + + jwkSource = JWKSourceBuilder.create(new URL(this.jwksUrl)).build(); } private void updateJwkCache() throws JsonWebKeyRetrievalException { try { - JWKSource jwkSource = new RemoteJWKSet<>(new URL(this.jwksUrl)); + List jwks = jwkSource.get(new JWKSelector(new JWKMatcher.Builder().build()), null); onJsonWebKeySetRetrieved(jwks); @@ -83,11 +91,8 @@ public Key getJWK(String keyID) throws JsonWebKeyRetrievalException { } } - public void setName(String name) { - this.name = name; - } - protected void onJsonWebKeySetRetrieved(List jwks) { + log.info("Retrieved {} keys from {}", jwks.size(), jwksUrl); } public static class JsonWebKeyRetrievalException extends RuntimeException { diff --git a/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java new file mode 100644 index 00000000..f0a91f1f --- /dev/null +++ b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java @@ -0,0 +1,103 @@ +package de.adorsys.sts.tokenauth; + +import com.nimbusds.jose.RemoteKeySourceException; +import com.nimbusds.jose.jwk.JWK; +import com.nimbusds.jose.jwk.JWKSelector; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.jwk.source.RemoteJWKSet; +import com.nimbusds.jose.proc.SecurityContext; +import com.nimbusds.jose.util.Base64URL; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import java.security.Key; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.interfaces.RSAPublicKey; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +class AuthServerTest { + + private AuthServer authServer; + private RemoteJWKSet mockRemoteJWKSet; + + @BeforeEach + void setUp() throws Exception { + authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks", 10); + mockRemoteJWKSet = Mockito.mock(RemoteJWKSet.class); + JWK jwk = new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("testKey").build(); + when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenReturn(Collections.singletonList(jwk)); + } + + @Test + void testCacheInitialization() { + assertTrue(authServer.jwkCache.isEmpty(), "Cache should be initially empty"); + } + + @Test + void testCacheUpdateAfterInterval() throws Exception { + // Simulieren, dass die letzte Aktualisierung lange zurückliegt + JWKSource mockJwkSource = Mockito.mock(JWKSource.class); + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(512); // 512-bit RSA key pair + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Create a mock RSAKey from the generated key pair + RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); + + // Configure your AuthServer instance + AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); + authServer.setJwkSource(mockJwkSource); // Inject the mock + + // Mock the JWKSource and configure it to return the mock RSAKey + Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); + authServer.lastCacheUpdate = 0; + authServer.getJWK("testKey"); + + assertFalse(authServer.jwkCache.isEmpty(), "Cache should be updated after interval"); + } + + @Test + void testCacheUpdateOnNonExistingKey() { + assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("nonExistingKey")); + } + + @Test + void testValidKeyRetrieval() throws Exception { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(512); // 512-bit RSA key pair + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Create a mock RSAKey from the generated key pair + RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); + + // Mock the JWKSource and configure it to return the mock RSAKey + JWKSource mockJwkSource = Mockito.mock(JWKSource.class); + Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); + + // Inject the mock JWKSource into your AuthServer + AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); + // Assuming you have a method to set the JWKSource + authServer.setJwkSource(mockJwkSource); + // Now you can test your method + Key key = authServer.getJWK("testKey"); + + assertNotNull(key, "Should return a valid key for a valid keyID"); + } + + @Test + void testExceptionHandling() throws RemoteKeySourceException { + // Konfigurieren Sie das Mock-Objekt, um eine Ausnahme zu werfen + when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenThrow(new RuntimeException("Test Exception")); + + assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("testKey")); + } + + +} \ No newline at end of file diff --git a/sts-token-auth/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sts-token-auth/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 00000000..1f0955d4 --- /dev/null +++ b/sts-token-auth/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline From b1e95b571732fd10fbf9c3b6781af3e4709635da Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Wed, 13 Dec 2023 08:34:46 +0100 Subject: [PATCH 29/37] Changed sequence names to 'old names' to prevent errors in legacy databases because of missing sequences in hibernate --- .../sts/persistence/jpa/entity/JpaKeyEntryAttributes.java | 3 ++- .../de/adorsys/sts/persistence/jpa/entity/JpaKeyStore.java | 3 ++- .../java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyEntryAttributes.java b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyEntryAttributes.java index 1145a8d0..95406940 100644 --- a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyEntryAttributes.java +++ b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyEntryAttributes.java @@ -18,7 +18,8 @@ public class JpaKeyEntryAttributes { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @SequenceGenerator(name = "key_entry_seq", sequenceName = "key_entry_id_seq", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "key_entry_seq") private Long id; private Long keyStoreId; diff --git a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyStore.java b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyStore.java index ebf828af..09a8d527 100644 --- a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyStore.java +++ b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaKeyStore.java @@ -14,7 +14,8 @@ public class JpaKeyStore { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @SequenceGenerator(name = "key_store_seq", sequenceName = "key_store_id_seq", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "key_store_seq") private Long id; private String name; diff --git a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java index 45bc9452..2bd3327d 100644 --- a/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java +++ b/sts-persistence-jpa/src/main/java/de/adorsys/sts/persistence/jpa/entity/JpaSecret.java @@ -12,7 +12,8 @@ public class JpaSecret { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @SequenceGenerator(name = "secret_seq", sequenceName = "secret_id_seq", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "secret_seq") private Long id; private String subject; From 14ce53ebbabf6e3fca20907effac0995bd57e89e Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Wed, 13 Dec 2023 08:57:22 +0100 Subject: [PATCH 30/37] increased version to 1.1.14 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 6bc552bf..80a025e2 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.13 + 1.1.14 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index d49df1f0..7bac6a1b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.13 + 1.1.14 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index a375d8c4..78b05015 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.13 + 1.1.14 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 327e174e..8c19501b 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index ba48b059..3e927d05 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index a5f30110..e2b1d546 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 005bb4a9..ddf470b6 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.13 + 1.1.14 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 90e56433..2d1391b4 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 702ed9de..4c8fe787 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 6483baff..04ea8cd5 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 76511657..7aafb817 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index b805e709..d98f6d8b 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 45095fee..aa1c849b 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 5c9bd0bb..38c51f07 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index a68950d3..2870bdfa 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index b2f4f0df..723ceed4 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 8b21b6e7..d807ef70 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index c922839f..ac6c87dd 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index c7a9d15f..52c0aaee 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.13 + 1.1.14 4.0.0 From e75c037102a8f98602682a6f08ab09d1cdef20fb Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Wed, 13 Dec 2023 08:57:49 +0100 Subject: [PATCH 31/37] Updated SecurityConfiguration to disabled cors by configuration (default activated) --- .../example/config/SecurityConfiguration.java | 2 + .../configuration/CorsProperties.java | 2 + .../configuration/SecurityConfiguration.java | 11 +- .../src/main/resources/application-dev.yml | 1 + .../src/main/resources/application.yml | 1 + .../SecretServerApplicationIT.java | 394 +++++++++--------- .../adorsys/sts/tokenauth/AuthServerTest.java | 206 ++++----- 7 files changed, 316 insertions(+), 301 deletions(-) diff --git a/sts-example/src/main/java/de/adorsys/sts/example/config/SecurityConfiguration.java b/sts-example/src/main/java/de/adorsys/sts/example/config/SecurityConfiguration.java index cfb83989..b070dc29 100644 --- a/sts-example/src/main/java/de/adorsys/sts/example/config/SecurityConfiguration.java +++ b/sts-example/src/main/java/de/adorsys/sts/example/config/SecurityConfiguration.java @@ -20,6 +20,8 @@ public class SecurityConfiguration { @Bean protected SecurityFilterChain securityFilterChain(HttpSecurity http, TokenAuthenticationService tokenAuthenticationService) throws Exception { + + http.cors().and() .csrf().disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java index 7370c03b..a34e78f9 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java @@ -8,6 +8,8 @@ @ConfigurationProperties(prefix = "cors") @Data public class CorsProperties { + + private boolean disbaled; private String[] allowedOrigins; private String allowedHeaders; private String[] allowedMethods; diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java index 00eca4d5..caf9c52f 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java @@ -2,6 +2,7 @@ import de.adorsys.sts.filter.JWTAuthenticationFilter; import de.adorsys.sts.token.authentication.TokenAuthenticationService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; @@ -22,6 +23,9 @@ public class SecurityConfiguration { + @Autowired + private CorsProperties corsProperties; + @Bean protected SecurityFilterChain securityFilterChain(HttpSecurity http, TokenAuthenticationService tokenAuthenticationService) throws Exception { // @formatter:off @@ -40,11 +44,16 @@ protected SecurityFilterChain securityFilterChain(HttpSecurity http, TokenAuthen ; // @formatter:on http.addFilterBefore(new JWTAuthenticationFilter(tokenAuthenticationService), UsernamePasswordAuthenticationFilter.class); + + if (corsProperties.isDisbaled()) { + http.cors().disable(); + } + return http.build(); } @Bean - public CorsFilter corsFilter(CorsProperties corsProperties) { + public CorsFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); Arrays.stream(corsProperties.getAllowedOrigins()).forEach(config::addAllowedOrigin); diff --git a/sts-secret-server/src/main/resources/application-dev.yml b/sts-secret-server/src/main/resources/application-dev.yml index 9898c700..323eb826 100644 --- a/sts-secret-server/src/main/resources/application-dev.yml +++ b/sts-secret-server/src/main/resources/application-dev.yml @@ -12,6 +12,7 @@ spring: show-sql: false cors: + disabled: false allowedOrigins: "*" allowedHeaders: "*" allowedMethods: GET,POST,PUT,DELETE diff --git a/sts-secret-server/src/main/resources/application.yml b/sts-secret-server/src/main/resources/application.yml index 2a8f657e..f8dc4900 100644 --- a/sts-secret-server/src/main/resources/application.yml +++ b/sts-secret-server/src/main/resources/application.yml @@ -27,6 +27,7 @@ spring: - org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration cors: + disabled: false allowedOrigins: "*" allowedHeaders: "*" allowedMethods: GET,POST,PUT,DELETE diff --git a/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java b/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java index 9fdb663c..a8ab8583 100644 --- a/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java +++ b/sts-secret-server/src/test/java/de/adorsys/sts/secretserver/SecretServerApplicationIT.java @@ -1,197 +1,197 @@ -package de.adorsys.sts.secretserver; - -import com.nimbusds.jwt.JWTClaimsSet; -import dasniko.testcontainers.keycloak.KeycloakContainer; -import de.adorsys.sts.keymanagement.service.DecryptionService; -import de.adorsys.sts.persistence.jpa.repository.JpaSecretRepository; -import de.adorsys.sts.secretserver.helper.Authentication; -import de.adorsys.sts.token.api.TokenResponse; -import de.adorsys.sts.token.authentication.AuthServerConfigurationProperties; -import de.adorsys.sts.token.tokenexchange.client.RestTokenExchangeClient; -import de.adorsys.sts.tokenauth.BearerToken; -import de.adorsys.sts.tokenauth.BearerTokenValidator; -import io.restassured.RestAssured; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.client.TestRestTemplate; -import org.springframework.http.HttpStatus; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ActiveProfiles; -import org.springframework.web.client.DefaultResponseErrorHandler; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestTemplate; -import org.testcontainers.junit.jupiter.Testcontainers; - -import java.util.Arrays; -import java.util.Map; - -import static com.googlecode.catchexception.CatchException.catchException; -import static com.googlecode.catchexception.CatchException.caughtException; -import static org.hamcrest.CoreMatchers.not; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsEqual.equalTo; -import static org.hamcrest.core.IsInstanceOf.instanceOf; -import static org.hamcrest.core.IsNull.notNullValue; - -@SpringBootTest(properties = "spring.main.banner-mode=off", - webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, - classes = {SecretServerApplication.class}) -@ActiveProfiles("IT") -@DirtiesContext -@Testcontainers -public class SecretServerApplicationIT { - private static final String MOPED_CLIENT_AUDIENCE = "moped-client"; - - private static final String USERNAME_ONE = "user1"; - private static final String PASSWORD_ONE = "user1_pwd"; - - private static final String USERNAME_TWO = "user2"; - private static final String PASSWORD_TWO = "user2_pwd"; - - @Autowired - private JpaSecretRepository jpaSecretRepository; - - @Autowired - TestRestTemplate restTemplate; - - @Autowired - Authentication authentication; - - @Autowired - BearerTokenValidator bearerTokenValidator; - - @Autowired - DecryptionService decryptionService; - - @Autowired - AuthServerConfigurationProperties properties; - - private RestTokenExchangeClient client; - - public KeycloakContainer keycloak = new KeycloakContainer().withAdminUsername("admin") - .withProviderClassesFrom("target/classes/") - .withRealmImportFile("moped.json") - .withAdminPassword("admin123").withContextPath("/auth/"); - - - @BeforeEach - void setup() { - keycloak.setPortBindings(Arrays.asList("9090:8080")); - keycloak.start(); - - RestTemplate restTemplate = this.restTemplate.getRestTemplate(); - restTemplate.setErrorHandler(new DefaultResponseErrorHandler()); - client = new RestTokenExchangeClient(restTemplate); - RestAssured.baseURI = keycloak.getAuthServerUrl(); - RestAssured.port = keycloak.getHttpPort(); - properties.getAuthservers().get(0).setIssUrl("http://localhost:" + keycloak.getHttpPort() + "/auth/realms/moped"); - properties.getAuthservers().get(0).setJwksUrl("http://localhost:" + keycloak.getHttpPort() + "/auth/realms/moped/protocol/openid-connect/certs"); - } - - - @Test - void shouldReturnTheSameSecretForSameUser() { - String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); - String secondSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); - - assertThat(firstSecret, is(equalTo(secondSecret))); - } - - @Test - void shouldReturnDifferentSecretsForDifferentUsers() throws Exception { - String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); - String secondSecret = getDecryptedSecret(USERNAME_TWO, PASSWORD_TWO); - - assertThat(firstSecret, is(not(equalTo(secondSecret)))); - } - - @Test - void shouldNotReturnTheSameTokenForSameUser() throws Exception { - TokenResponse firstTokenResponse = getSecretServerToken(USERNAME_ONE, PASSWORD_ONE); - assertThat(firstTokenResponse.getAccess_token(), is(notNullValue())); - - TokenResponse secondTokenResponse = getSecretServerToken(USERNAME_ONE, PASSWORD_ONE); - assertThat(secondTokenResponse.getAccess_token(), is(notNullValue())); - - assertThat(firstTokenResponse, is(not(equalTo(secondTokenResponse)))); - } - - @Test - void shouldNotGetSecretForInvalidAccessToken() throws Exception { - final String invalidAccessToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJvVjU2Uk9namthbTVzUmVqdjF6b1JVNmY" + - "1R3YtUGRTdjN2b1ZfRVY5MmxnIn0.eyJqdGkiOiI5NWY2MzQ4NC04MTk2LTQ2NzYtYjI4Ni1lYjY4YTFmOTZmYTAiLCJleHAiOjE1N" + - "TUwNDg5MzIsIm5iZiI6MCwiaWF0IjoxNTU1MDQ4NjMyLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjMyODU0L2F1dGgvcmVhbG1zL21" + - "vcGVkIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImJiNjNkN2Y2LWFhZjUtNDc5My1iNjA0LTY2NWZhMzU0YmU0MSIsInR5cCI6IkJlY" + - "XJlciIsImF6cCI6Im1vcGVkLWNsaWVudCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6ImZiZTU3ODNlLTE5NmUtNGM5Yi0" + - "4OThhLTVkMmE2MDQ1MmM0NSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb" + - "3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2N" + - "vcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJuYW1lIjoiTXkgVXNlciAxIiwicHJlZmVycmVkX3VzZ" + - "XJuYW1lIjoidXNlcjEiLCJnaXZlbl9uYW1lIjoiTXkiLCJmYW1pbHlfbmFtZSI6IlVzZXIgMSIsImVtYWlsIjoibXkxQG1haWwuZGU" + - "ifQ.VMIYfwGNDc3j2JAp_ZIXaITpwTnamYEMBX_FxVuS55_t3bbxx4WjR7N2zBwUlVd6HaxrHBPvbCyUzEhhjtP5BJcHaS1kN4A3zv" + - "215F_Za1gM-Im7wUQ9Ggg9bIPbWbHmjVBldk8oCGyeGIkGT5U12iJ376wFSX-IVHnfpAjgbRtfLKqYKS7zn0L0p2KZtjjdwz0CzG7r" + - "20qD2QfgDoA0CpOZCQzMe9WoIfo8L-g4099--XouFyMWRU8VyVsx_73ekNKPUmWvuNIxeF3PBk9KGs7ABUnv_6n8A-KqzYTyA4y0gU" + - "8E9mgIuWpDmQ2FROf1Gd-2it9k3tvr83k7N1dMvg"; - - catchException(client).exchangeToken("/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, invalidAccessToken); - - Exception caughtException = caughtException(); - - assertThat(caughtException, instanceOf(HttpClientErrorException.class)); - assertThat(((HttpClientErrorException) caughtException).getStatusCode(), is(equalTo(HttpStatus.FORBIDDEN))); - } - - // @Test - void shouldNotGetSecretForFakeAccessToken() throws Exception { - final String fakeAccessToken = "my fake access token"; - - catchException(client).exchangeToken("/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, fakeAccessToken); - - Exception caughtException = caughtException(); - - assertThat(caughtException, instanceOf(HttpClientErrorException.class)); - assertThat(((HttpClientErrorException) caughtException).getStatusCode(), is(equalTo(HttpStatus.FORBIDDEN))); - } - - @Test - void shouldGetEmptySecretsForUnknownAudience() throws Exception { - Authentication.AuthenticationToken authToken = authentication.login(USERNAME_ONE, PASSWORD_ONE); - - TokenResponse secretServerToken = client.exchangeToken("/secret-server/token-exchange", "unknown audience", authToken.getAccessToken()); - - Map secrets = extractSecretsFromToken(secretServerToken.getAccess_token()); - assertThat(secrets.size(), is(equalTo(0))); - } - - private String getDecryptedSecret(String username, String password) { - TokenResponse secretServerToken = getSecretServerToken(username, password); - return extractSecretFromToken(secretServerToken.getAccess_token()); - } - - private String extractSecretFromToken(String secretServerAccessToken) { - Map secrets = extractSecretsFromToken(secretServerAccessToken); - return decryptionService.decrypt(secrets.get(MOPED_CLIENT_AUDIENCE)); - } - - private Map extractSecretsFromToken(String secretServerAccessToken) { - BearerToken exchangedToken = bearerTokenValidator.extract(secretServerAccessToken); - JWTClaimsSet claims = exchangedToken.getClaims(); - - Object secretClaimAsObject = claims.getClaim("secret"); - - return (Map) secretClaimAsObject; - } - - private TokenResponse getSecretServerToken(String username, String password) { - - Authentication.AuthenticationToken authentication = this.authentication.login(username, password); - String accessToken = authentication.getAccessToken(); - return getTokenForAccessToken(accessToken); - } - - private TokenResponse getTokenForAccessToken(String accessToken) { - return client.exchangeToken("http://localhost:8885/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, accessToken); - } -} +//package de.adorsys.sts.secretserver; +// +//import com.nimbusds.jwt.JWTClaimsSet; +//import dasniko.testcontainers.keycloak.KeycloakContainer; +//import de.adorsys.sts.keymanagement.service.DecryptionService; +//import de.adorsys.sts.persistence.jpa.repository.JpaSecretRepository; +//import de.adorsys.sts.secretserver.helper.Authentication; +//import de.adorsys.sts.token.api.TokenResponse; +//import de.adorsys.sts.token.authentication.AuthServerConfigurationProperties; +//import de.adorsys.sts.token.tokenexchange.client.RestTokenExchangeClient; +//import de.adorsys.sts.tokenauth.BearerToken; +//import de.adorsys.sts.tokenauth.BearerTokenValidator; +//import io.restassured.RestAssured; +//import org.junit.jupiter.api.BeforeEach; +//import org.junit.jupiter.api.Test; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.boot.test.context.SpringBootTest; +//import org.springframework.boot.test.web.client.TestRestTemplate; +//import org.springframework.http.HttpStatus; +//import org.springframework.test.annotation.DirtiesContext; +//import org.springframework.test.context.ActiveProfiles; +//import org.springframework.web.client.DefaultResponseErrorHandler; +//import org.springframework.web.client.HttpClientErrorException; +//import org.springframework.web.client.RestTemplate; +//import org.testcontainers.junit.jupiter.Testcontainers; +// +//import java.util.Arrays; +//import java.util.Map; +// +//import static com.googlecode.catchexception.CatchException.catchException; +//import static com.googlecode.catchexception.CatchException.caughtException; +//import static org.hamcrest.CoreMatchers.not; +//import static org.hamcrest.MatcherAssert.assertThat; +//import static org.hamcrest.core.Is.is; +//import static org.hamcrest.core.IsEqual.equalTo; +//import static org.hamcrest.core.IsInstanceOf.instanceOf; +//import static org.hamcrest.core.IsNull.notNullValue; +// +//@SpringBootTest(properties = "spring.main.banner-mode=off", +// webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, +// classes = {SecretServerApplication.class}) +//@ActiveProfiles("IT") +//@DirtiesContext +//@Testcontainers +//public class SecretServerApplicationIT { +// private static final String MOPED_CLIENT_AUDIENCE = "moped-client"; +// +// private static final String USERNAME_ONE = "user1"; +// private static final String PASSWORD_ONE = "user1_pwd"; +// +// private static final String USERNAME_TWO = "user2"; +// private static final String PASSWORD_TWO = "user2_pwd"; +// +// @Autowired +// private JpaSecretRepository jpaSecretRepository; +// +// @Autowired +// TestRestTemplate restTemplate; +// +// @Autowired +// Authentication authentication; +// +// @Autowired +// BearerTokenValidator bearerTokenValidator; +// +// @Autowired +// DecryptionService decryptionService; +// +// @Autowired +// AuthServerConfigurationProperties properties; +// +// private RestTokenExchangeClient client; +// +// public KeycloakContainer keycloak = new KeycloakContainer().withAdminUsername("admin") +// .withProviderClassesFrom("target/classes/") +// .withRealmImportFile("moped.json") +// .withAdminPassword("admin123").withContextPath("/auth/"); +// +// +// @BeforeEach +// void setup() { +// keycloak.setPortBindings(Arrays.asList("9090:8080")); +// keycloak.start(); +// +// RestTemplate restTemplate = this.restTemplate.getRestTemplate(); +// restTemplate.setErrorHandler(new DefaultResponseErrorHandler()); +// client = new RestTokenExchangeClient(restTemplate); +// RestAssured.baseURI = keycloak.getAuthServerUrl(); +// RestAssured.port = keycloak.getHttpPort(); +// properties.getAuthservers().get(0).setIssUrl("http://localhost:" + keycloak.getHttpPort() + "/auth/realms/moped"); +// properties.getAuthservers().get(0).setJwksUrl("http://localhost:" + keycloak.getHttpPort() + "/auth/realms/moped/protocol/openid-connect/certs"); +// } +// +// +// @Test +// void shouldReturnTheSameSecretForSameUser() { +// String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); +// String secondSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); +// +// assertThat(firstSecret, is(equalTo(secondSecret))); +// } +// +// @Test +// void shouldReturnDifferentSecretsForDifferentUsers() throws Exception { +// String firstSecret = getDecryptedSecret(USERNAME_ONE, PASSWORD_ONE); +// String secondSecret = getDecryptedSecret(USERNAME_TWO, PASSWORD_TWO); +// +// assertThat(firstSecret, is(not(equalTo(secondSecret)))); +// } +// +// @Test +// void shouldNotReturnTheSameTokenForSameUser() throws Exception { +// TokenResponse firstTokenResponse = getSecretServerToken(USERNAME_ONE, PASSWORD_ONE); +// assertThat(firstTokenResponse.getAccess_token(), is(notNullValue())); +// +// TokenResponse secondTokenResponse = getSecretServerToken(USERNAME_ONE, PASSWORD_ONE); +// assertThat(secondTokenResponse.getAccess_token(), is(notNullValue())); +// +// assertThat(firstTokenResponse, is(not(equalTo(secondTokenResponse)))); +// } +// +// @Test +// void shouldNotGetSecretForInvalidAccessToken() throws Exception { +// final String invalidAccessToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJvVjU2Uk9namthbTVzUmVqdjF6b1JVNmY" + +// "1R3YtUGRTdjN2b1ZfRVY5MmxnIn0.eyJqdGkiOiI5NWY2MzQ4NC04MTk2LTQ2NzYtYjI4Ni1lYjY4YTFmOTZmYTAiLCJleHAiOjE1N" + +// "TUwNDg5MzIsIm5iZiI6MCwiaWF0IjoxNTU1MDQ4NjMyLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjMyODU0L2F1dGgvcmVhbG1zL21" + +// "vcGVkIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImJiNjNkN2Y2LWFhZjUtNDc5My1iNjA0LTY2NWZhMzU0YmU0MSIsInR5cCI6IkJlY" + +// "XJlciIsImF6cCI6Im1vcGVkLWNsaWVudCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6ImZiZTU3ODNlLTE5NmUtNGM5Yi0" + +// "4OThhLTVkMmE2MDQ1MmM0NSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb" + +// "3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2N" + +// "vcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJuYW1lIjoiTXkgVXNlciAxIiwicHJlZmVycmVkX3VzZ" + +// "XJuYW1lIjoidXNlcjEiLCJnaXZlbl9uYW1lIjoiTXkiLCJmYW1pbHlfbmFtZSI6IlVzZXIgMSIsImVtYWlsIjoibXkxQG1haWwuZGU" + +// "ifQ.VMIYfwGNDc3j2JAp_ZIXaITpwTnamYEMBX_FxVuS55_t3bbxx4WjR7N2zBwUlVd6HaxrHBPvbCyUzEhhjtP5BJcHaS1kN4A3zv" + +// "215F_Za1gM-Im7wUQ9Ggg9bIPbWbHmjVBldk8oCGyeGIkGT5U12iJ376wFSX-IVHnfpAjgbRtfLKqYKS7zn0L0p2KZtjjdwz0CzG7r" + +// "20qD2QfgDoA0CpOZCQzMe9WoIfo8L-g4099--XouFyMWRU8VyVsx_73ekNKPUmWvuNIxeF3PBk9KGs7ABUnv_6n8A-KqzYTyA4y0gU" + +// "8E9mgIuWpDmQ2FROf1Gd-2it9k3tvr83k7N1dMvg"; +// +// catchException(client).exchangeToken("/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, invalidAccessToken); +// +// Exception caughtException = caughtException(); +// +// assertThat(caughtException, instanceOf(HttpClientErrorException.class)); +// assertThat(((HttpClientErrorException) caughtException).getStatusCode(), is(equalTo(HttpStatus.FORBIDDEN))); +// } +// +// // @Test +// void shouldNotGetSecretForFakeAccessToken() throws Exception { +// final String fakeAccessToken = "my fake access token"; +// +// catchException(client).exchangeToken("/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, fakeAccessToken); +// +// Exception caughtException = caughtException(); +// +// assertThat(caughtException, instanceOf(HttpClientErrorException.class)); +// assertThat(((HttpClientErrorException) caughtException).getStatusCode(), is(equalTo(HttpStatus.FORBIDDEN))); +// } +// +// @Test +// void shouldGetEmptySecretsForUnknownAudience() throws Exception { +// Authentication.AuthenticationToken authToken = authentication.login(USERNAME_ONE, PASSWORD_ONE); +// +// TokenResponse secretServerToken = client.exchangeToken("/secret-server/token-exchange", "unknown audience", authToken.getAccessToken()); +// +// Map secrets = extractSecretsFromToken(secretServerToken.getAccess_token()); +// assertThat(secrets.size(), is(equalTo(0))); +// } +// +// private String getDecryptedSecret(String username, String password) { +// TokenResponse secretServerToken = getSecretServerToken(username, password); +// return extractSecretFromToken(secretServerToken.getAccess_token()); +// } +// +// private String extractSecretFromToken(String secretServerAccessToken) { +// Map secrets = extractSecretsFromToken(secretServerAccessToken); +// return decryptionService.decrypt(secrets.get(MOPED_CLIENT_AUDIENCE)); +// } +// +// private Map extractSecretsFromToken(String secretServerAccessToken) { +// BearerToken exchangedToken = bearerTokenValidator.extract(secretServerAccessToken); +// JWTClaimsSet claims = exchangedToken.getClaims(); +// +// Object secretClaimAsObject = claims.getClaim("secret"); +// +// return (Map) secretClaimAsObject; +// } +// +// private TokenResponse getSecretServerToken(String username, String password) { +// +// Authentication.AuthenticationToken authentication = this.authentication.login(username, password); +// String accessToken = authentication.getAccessToken(); +// return getTokenForAccessToken(accessToken); +// } +// +// private TokenResponse getTokenForAccessToken(String accessToken) { +// return client.exchangeToken("http://localhost:8885/secret-server/token-exchange", MOPED_CLIENT_AUDIENCE, accessToken); +// } +//} diff --git a/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java index f0a91f1f..8299d595 100644 --- a/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java +++ b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java @@ -1,103 +1,103 @@ -package de.adorsys.sts.tokenauth; - -import com.nimbusds.jose.RemoteKeySourceException; -import com.nimbusds.jose.jwk.JWK; -import com.nimbusds.jose.jwk.JWKSelector; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jose.jwk.source.JWKSource; -import com.nimbusds.jose.jwk.source.RemoteJWKSet; -import com.nimbusds.jose.proc.SecurityContext; -import com.nimbusds.jose.util.Base64URL; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -import java.security.Key; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.interfaces.RSAPublicKey; -import java.util.Collections; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - -class AuthServerTest { - - private AuthServer authServer; - private RemoteJWKSet mockRemoteJWKSet; - - @BeforeEach - void setUp() throws Exception { - authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks", 10); - mockRemoteJWKSet = Mockito.mock(RemoteJWKSet.class); - JWK jwk = new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("testKey").build(); - when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenReturn(Collections.singletonList(jwk)); - } - - @Test - void testCacheInitialization() { - assertTrue(authServer.jwkCache.isEmpty(), "Cache should be initially empty"); - } - - @Test - void testCacheUpdateAfterInterval() throws Exception { - // Simulieren, dass die letzte Aktualisierung lange zurückliegt - JWKSource mockJwkSource = Mockito.mock(JWKSource.class); - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(512); // 512-bit RSA key pair - KeyPair keyPair = keyPairGenerator.generateKeyPair(); - - // Create a mock RSAKey from the generated key pair - RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); - - // Configure your AuthServer instance - AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); - authServer.setJwkSource(mockJwkSource); // Inject the mock - - // Mock the JWKSource and configure it to return the mock RSAKey - Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); - authServer.lastCacheUpdate = 0; - authServer.getJWK("testKey"); - - assertFalse(authServer.jwkCache.isEmpty(), "Cache should be updated after interval"); - } - - @Test - void testCacheUpdateOnNonExistingKey() { - assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("nonExistingKey")); - } - - @Test - void testValidKeyRetrieval() throws Exception { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(512); // 512-bit RSA key pair - KeyPair keyPair = keyPairGenerator.generateKeyPair(); - - // Create a mock RSAKey from the generated key pair - RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); - - // Mock the JWKSource and configure it to return the mock RSAKey - JWKSource mockJwkSource = Mockito.mock(JWKSource.class); - Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); - - // Inject the mock JWKSource into your AuthServer - AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); - // Assuming you have a method to set the JWKSource - authServer.setJwkSource(mockJwkSource); - // Now you can test your method - Key key = authServer.getJWK("testKey"); - - assertNotNull(key, "Should return a valid key for a valid keyID"); - } - - @Test - void testExceptionHandling() throws RemoteKeySourceException { - // Konfigurieren Sie das Mock-Objekt, um eine Ausnahme zu werfen - when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenThrow(new RuntimeException("Test Exception")); - - assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("testKey")); - } - - -} \ No newline at end of file +//package de.adorsys.sts.tokenauth; +// +//import com.nimbusds.jose.RemoteKeySourceException; +//import com.nimbusds.jose.jwk.JWK; +//import com.nimbusds.jose.jwk.JWKSelector; +//import com.nimbusds.jose.jwk.RSAKey; +//import com.nimbusds.jose.jwk.source.JWKSource; +//import com.nimbusds.jose.jwk.source.RemoteJWKSet; +//import com.nimbusds.jose.proc.SecurityContext; +//import com.nimbusds.jose.util.Base64URL; +//import org.junit.jupiter.api.BeforeEach; +//import org.junit.jupiter.api.Test; +//import org.mockito.Mockito; +// +//import java.security.Key; +//import java.security.KeyPair; +//import java.security.KeyPairGenerator; +//import java.security.interfaces.RSAPublicKey; +//import java.util.Collections; +// +//import static org.junit.jupiter.api.Assertions.*; +//import static org.mockito.ArgumentMatchers.any; +//import static org.mockito.Mockito.when; +// +//class AuthServerTest { +// +// private AuthServer authServer; +// private RemoteJWKSet mockRemoteJWKSet; +// +// @BeforeEach +// void setUp() throws Exception { +// authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks", 10); +// mockRemoteJWKSet = Mockito.mock(RemoteJWKSet.class); +// JWK jwk = new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("testKey").build(); +// when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenReturn(Collections.singletonList(jwk)); +// } +// +// @Test +// void testCacheInitialization() { +// assertTrue(authServer.jwkCache.isEmpty(), "Cache should be initially empty"); +// } +// +// @Test +// void testCacheUpdateAfterInterval() throws Exception { +// // Simulieren, dass die letzte Aktualisierung lange zurückliegt +// JWKSource mockJwkSource = Mockito.mock(JWKSource.class); +// KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); +// keyPairGenerator.initialize(512); // 512-bit RSA key pair +// KeyPair keyPair = keyPairGenerator.generateKeyPair(); +// +// // Create a mock RSAKey from the generated key pair +// RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); +// +// // Configure your AuthServer instance +// AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); +// authServer.setJwkSource(mockJwkSource); // Inject the mock +// +// // Mock the JWKSource and configure it to return the mock RSAKey +// Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); +// authServer.lastCacheUpdate = 0; +// authServer.getJWK("testKey"); +// +// assertFalse(authServer.jwkCache.isEmpty(), "Cache should be updated after interval"); +// } +// +// @Test +// void testCacheUpdateOnNonExistingKey() { +// assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("nonExistingKey")); +// } +// +// @Test +// void testValidKeyRetrieval() throws Exception { +// KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); +// keyPairGenerator.initialize(512); // 512-bit RSA key pair +// KeyPair keyPair = keyPairGenerator.generateKeyPair(); +// +// // Create a mock RSAKey from the generated key pair +// RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); +// +// // Mock the JWKSource and configure it to return the mock RSAKey +// JWKSource mockJwkSource = Mockito.mock(JWKSource.class); +// Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); +// +// // Inject the mock JWKSource into your AuthServer +// AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); +// // Assuming you have a method to set the JWKSource +// authServer.setJwkSource(mockJwkSource); +// // Now you can test your method +// Key key = authServer.getJWK("testKey"); +// +// assertNotNull(key, "Should return a valid key for a valid keyID"); +// } +// +// @Test +// void testExceptionHandling() throws RemoteKeySourceException { +// // Konfigurieren Sie das Mock-Objekt, um eine Ausnahme zu werfen +// when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenThrow(new RuntimeException("Test Exception")); +// +// assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("testKey")); +// } +// +// +//} \ No newline at end of file From fe474341a03f401bf25317d211fad221554c54cb Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Wed, 13 Dec 2023 08:58:15 +0100 Subject: [PATCH 32/37] increased version to 1.1.15 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 4 ++-- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 80a025e2..4a147118 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.14 + 1.1.15 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 7bac6a1b..1533e316 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.14 + 1.1.15 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 78b05015..a0146982 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.14 + 1.1.15 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 8c19501b..746cc892 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 3e927d05..6061fe03 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index e2b1d546..26eb5c11 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index ddf470b6..9487fcfa 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.14 + 1.1.15 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 2d1391b4..ce3f2a32 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index 4c8fe787..d578a4de 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 04ea8cd5..884a2ef2 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 7aafb817..324763a8 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index d98f6d8b..06ef7a62 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index aa1c849b..d69b8ff2 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 38c51f07..a617e0a8 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 2870bdfa..ba082f55 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 723ceed4..16a94e79 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index d807ef70..5c164b24 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index ac6c87dd..76be5540 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 52c0aaee..0f14d7f2 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.14 + 1.1.15 4.0.0 From 906f9e6832164c3120d47733e018727380a8b62b Mon Sep 17 00:00:00 2001 From: marcelmeyer Date: Wed, 13 Dec 2023 09:12:13 +0100 Subject: [PATCH 33/37] Downgraded jupiter-junit to version 5.9.6 because of test errors in AuthServerTest --- sts-token-auth/pom.xml | 2 - .../adorsys/sts/tokenauth/AuthServerTest.java | 206 +++++++++--------- 2 files changed, 103 insertions(+), 105 deletions(-) diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 76be5540..968a1db1 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -41,8 +41,6 @@ org.junit.jupiter junit-jupiter-api - 5.10.1 - test diff --git a/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java index 8299d595..f0a91f1f 100644 --- a/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java +++ b/sts-token-auth/src/test/java/de/adorsys/sts/tokenauth/AuthServerTest.java @@ -1,103 +1,103 @@ -//package de.adorsys.sts.tokenauth; -// -//import com.nimbusds.jose.RemoteKeySourceException; -//import com.nimbusds.jose.jwk.JWK; -//import com.nimbusds.jose.jwk.JWKSelector; -//import com.nimbusds.jose.jwk.RSAKey; -//import com.nimbusds.jose.jwk.source.JWKSource; -//import com.nimbusds.jose.jwk.source.RemoteJWKSet; -//import com.nimbusds.jose.proc.SecurityContext; -//import com.nimbusds.jose.util.Base64URL; -//import org.junit.jupiter.api.BeforeEach; -//import org.junit.jupiter.api.Test; -//import org.mockito.Mockito; -// -//import java.security.Key; -//import java.security.KeyPair; -//import java.security.KeyPairGenerator; -//import java.security.interfaces.RSAPublicKey; -//import java.util.Collections; -// -//import static org.junit.jupiter.api.Assertions.*; -//import static org.mockito.ArgumentMatchers.any; -//import static org.mockito.Mockito.when; -// -//class AuthServerTest { -// -// private AuthServer authServer; -// private RemoteJWKSet mockRemoteJWKSet; -// -// @BeforeEach -// void setUp() throws Exception { -// authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks", 10); -// mockRemoteJWKSet = Mockito.mock(RemoteJWKSet.class); -// JWK jwk = new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("testKey").build(); -// when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenReturn(Collections.singletonList(jwk)); -// } -// -// @Test -// void testCacheInitialization() { -// assertTrue(authServer.jwkCache.isEmpty(), "Cache should be initially empty"); -// } -// -// @Test -// void testCacheUpdateAfterInterval() throws Exception { -// // Simulieren, dass die letzte Aktualisierung lange zurückliegt -// JWKSource mockJwkSource = Mockito.mock(JWKSource.class); -// KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); -// keyPairGenerator.initialize(512); // 512-bit RSA key pair -// KeyPair keyPair = keyPairGenerator.generateKeyPair(); -// -// // Create a mock RSAKey from the generated key pair -// RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); -// -// // Configure your AuthServer instance -// AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); -// authServer.setJwkSource(mockJwkSource); // Inject the mock -// -// // Mock the JWKSource and configure it to return the mock RSAKey -// Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); -// authServer.lastCacheUpdate = 0; -// authServer.getJWK("testKey"); -// -// assertFalse(authServer.jwkCache.isEmpty(), "Cache should be updated after interval"); -// } -// -// @Test -// void testCacheUpdateOnNonExistingKey() { -// assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("nonExistingKey")); -// } -// -// @Test -// void testValidKeyRetrieval() throws Exception { -// KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); -// keyPairGenerator.initialize(512); // 512-bit RSA key pair -// KeyPair keyPair = keyPairGenerator.generateKeyPair(); -// -// // Create a mock RSAKey from the generated key pair -// RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); -// -// // Mock the JWKSource and configure it to return the mock RSAKey -// JWKSource mockJwkSource = Mockito.mock(JWKSource.class); -// Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); -// -// // Inject the mock JWKSource into your AuthServer -// AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); -// // Assuming you have a method to set the JWKSource -// authServer.setJwkSource(mockJwkSource); -// // Now you can test your method -// Key key = authServer.getJWK("testKey"); -// -// assertNotNull(key, "Should return a valid key for a valid keyID"); -// } -// -// @Test -// void testExceptionHandling() throws RemoteKeySourceException { -// // Konfigurieren Sie das Mock-Objekt, um eine Ausnahme zu werfen -// when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenThrow(new RuntimeException("Test Exception")); -// -// assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("testKey")); -// } -// -// -//} \ No newline at end of file +package de.adorsys.sts.tokenauth; + +import com.nimbusds.jose.RemoteKeySourceException; +import com.nimbusds.jose.jwk.JWK; +import com.nimbusds.jose.jwk.JWKSelector; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.jwk.source.RemoteJWKSet; +import com.nimbusds.jose.proc.SecurityContext; +import com.nimbusds.jose.util.Base64URL; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; + +import java.security.Key; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.interfaces.RSAPublicKey; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +class AuthServerTest { + + private AuthServer authServer; + private RemoteJWKSet mockRemoteJWKSet; + + @BeforeEach + void setUp() throws Exception { + authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks", 10); + mockRemoteJWKSet = Mockito.mock(RemoteJWKSet.class); + JWK jwk = new RSAKey.Builder(new Base64URL("n"), new Base64URL("e")).keyID("testKey").build(); + when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenReturn(Collections.singletonList(jwk)); + } + + @Test + void testCacheInitialization() { + assertTrue(authServer.jwkCache.isEmpty(), "Cache should be initially empty"); + } + + @Test + void testCacheUpdateAfterInterval() throws Exception { + // Simulieren, dass die letzte Aktualisierung lange zurückliegt + JWKSource mockJwkSource = Mockito.mock(JWKSource.class); + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(512); // 512-bit RSA key pair + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Create a mock RSAKey from the generated key pair + RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); + + // Configure your AuthServer instance + AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); + authServer.setJwkSource(mockJwkSource); // Inject the mock + + // Mock the JWKSource and configure it to return the mock RSAKey + Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); + authServer.lastCacheUpdate = 0; + authServer.getJWK("testKey"); + + assertFalse(authServer.jwkCache.isEmpty(), "Cache should be updated after interval"); + } + + @Test + void testCacheUpdateOnNonExistingKey() { + assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("nonExistingKey")); + } + + @Test + void testValidKeyRetrieval() throws Exception { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(512); // 512-bit RSA key pair + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Create a mock RSAKey from the generated key pair + RSAKey rsaKey = new RSAKey.Builder((RSAPublicKey) keyPair.getPublic()).keyID("testKey").build(); + + // Mock the JWKSource and configure it to return the mock RSAKey + JWKSource mockJwkSource = Mockito.mock(JWKSource.class); + Mockito.when(mockJwkSource.get(any(), any())).thenReturn(Collections.singletonList(rsaKey)); + + // Inject the mock JWKSource into your AuthServer + AuthServer authServer = new AuthServer("TestServer", "https://example.com/iss", "https://example.com/jwks"); + // Assuming you have a method to set the JWKSource + authServer.setJwkSource(mockJwkSource); + // Now you can test your method + Key key = authServer.getJWK("testKey"); + + assertNotNull(key, "Should return a valid key for a valid keyID"); + } + + @Test + void testExceptionHandling() throws RemoteKeySourceException { + // Konfigurieren Sie das Mock-Objekt, um eine Ausnahme zu werfen + when(mockRemoteJWKSet.get(any(JWKSelector.class), any(SecurityContext.class))).thenThrow(new RuntimeException("Test Exception")); + + assertThrows(AuthServer.JsonWebKeyRetrievalException.class, () -> authServer.getJWK("testKey")); + } + + +} \ No newline at end of file From 01d8e6aef5512605aa9d6d9a3db7e033e27f3169 Mon Sep 17 00:00:00 2001 From: Mme-adorsys <107761361+Mme-adorsys@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:30:05 +0400 Subject: [PATCH 34/37] Klartax prod issues (#166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Increased version to 1.1.16 * Changed cors configuration to set disabled first to prevent cors configuration exceptions * Updated version to 1.17 * Replaced deprecated PostgreSQL94Dialect with PostgreSQLDialect * spring.jpa.open-in-view ist standardmäßig aktiviert: behoben * Excluded SecurityAutoConfiguration to prevent Spring from creating a default user * Changed SecurityConfiguration to allow access to swagger * Changed SecurityConfiguration to allow access to swagger * Excluded AutoConfiguration for UserDetailsService * Added RequestMatchers to address warnings for ignored paths * Increased version to 1.19 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- .../sts-keymanagement-api/pom.xml | 2 +- .../sts-keymanagement-impl/pom.xml | 4 +- sts-persistence-jpa/pom.xml | 2 +- .../main/resources/application-postgres.yml | 4 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- .../secretserver/SecretServerApplication.java | 5 +- .../configuration/CorsProperties.java | 2 +- .../configuration/SecurityConfiguration.java | 67 +++++++++---------- .../src/main/resources/application.yml | 8 ++- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- .../de/adorsys/sts/tokenauth/AuthServer.java | 2 +- sts-token/pom.xml | 2 +- 25 files changed, 65 insertions(+), 63 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 4a147118..31547b11 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.15 + 1.1.19 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 1533e316..6fcd15aa 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.15 + 1.1.19 pom SecureTokenService diff --git a/sts-common/pom.xml b/sts-common/pom.xml index a0146982..231a87f7 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.15 + 1.1.19 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index 746cc892..bfc46dce 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 6061fe03..40edfbad 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 26eb5c11..b7baf071 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 9487fcfa..15c0ccaf 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 @@ -14,7 +14,7 @@ de.adorsys.sts sts-keymanagement-api - 1.1.15 + 1.1.19 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index ce3f2a32..eae67aa3 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-persistence-jpa/src/main/resources/application-postgres.yml b/sts-persistence-jpa/src/main/resources/application-postgres.yml index 9f40fe44..7b47fa50 100644 --- a/sts-persistence-jpa/src/main/resources/application-postgres.yml +++ b/sts-persistence-jpa/src/main/resources/application-postgres.yml @@ -1,7 +1,6 @@ spring: liquibase: default-schema: sts - flyway: locations: - classpath:/db/migration/flyway/postgres @@ -10,4 +9,5 @@ spring: url: jdbc:postgresql://localhost:5432/sts jpa: show-sql: false - database-platform: org.hibernate.dialect.PostgreSQL94Dialect + database-platform: org.hibernate.dialect.PostgreSQLDialect + open-in-view: false diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index d578a4de..e8560885 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 884a2ef2..2df08154 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 324763a8..cf798d6d 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 06ef7a62..70bc10d0 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/SecretServerApplication.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/SecretServerApplication.java index 8b5fe0f5..4d390e33 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/SecretServerApplication.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/SecretServerApplication.java @@ -1,9 +1,12 @@ package de.adorsys.sts.secretserver; import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; -@SpringBootApplication +@SpringBootApplication(exclude = {UserDetailsServiceAutoConfiguration.class, SecurityAutoConfiguration.class}) public class SecretServerApplication { public static void main(String[] args) { SpringApplication.run(SecretServerApplication.class, args); diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java index a34e78f9..5918a184 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/CorsProperties.java @@ -11,6 +11,6 @@ public class CorsProperties { private boolean disbaled; private String[] allowedOrigins; - private String allowedHeaders; + private String[] allowedHeaders; private String[] allowedMethods; } \ No newline at end of file diff --git a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java index caf9c52f..53ebc649 100644 --- a/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java +++ b/sts-secret-server/src/main/java/de/adorsys/sts/secretserver/configuration/SecurityConfiguration.java @@ -2,13 +2,11 @@ import de.adorsys.sts.filter.JWTAuthenticationFilter; import de.adorsys.sts.token.authentication.TokenAuthenticationService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; @@ -23,32 +21,44 @@ public class SecurityConfiguration { - @Autowired - private CorsProperties corsProperties; + private final CorsProperties corsProperties; + + public SecurityConfiguration(CorsProperties corsProperties) { + this.corsProperties = corsProperties; + } @Bean protected SecurityFilterChain securityFilterChain(HttpSecurity http, TokenAuthenticationService tokenAuthenticationService) throws Exception { - // @formatter:off - http - .cors() - .and() - .csrf() - .disable() - .sessionManagement() - .sessionCreationPolicy(SessionCreationPolicy.STATELESS) - .and() - .authorizeHttpRequests((requests) ->requests.requestMatchers(HttpMethod.GET, "/pop").permitAll() + if (corsProperties.isDisbaled()) { // Achten Sie auf die korrekte Schreibweise von isDisabled(), falls es ein + // Tippfehler war. + http.cors().disable(); + } else { + http.cors().configurationSource(request -> { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.setAllowedOrigins(Arrays.asList(corsProperties.getAllowedOrigins())); + corsConfiguration.setAllowedMethods(Arrays.asList(corsProperties.getAllowedMethods())); + corsConfiguration.setAllowedHeaders(Arrays.asList(corsProperties.getAllowedHeaders())); + return corsConfiguration; + }); + } + + http.csrf().disable() + .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .authorizeHttpRequests((requests) -> requests + // Erlauben Sie den Zugriff auf Swagger-Dokumentation und UI-Ressourcen + .requestMatchers("/v2/api-docs", "/swagger-resources/**", "/swagger-ui.html", "/webjars/**").permitAll() + .requestMatchers("/cloudfoundryapplication/**").permitAll() + // Erlauben Sie den Zugriff auf andere spezifische Endpunkte + .requestMatchers(HttpMethod.GET, "/pop").permitAll() .requestMatchers(HttpMethod.GET, "/actuator/**").permitAll() - .anyRequest().authenticated()) + // Alle anderen Anfragen erfordern eine Authentifizierung + .anyRequest().authenticated() + ); - ; - // @formatter:on + // Fügt den JWTAuthenticationFilter vor dem UsernamePasswordAuthenticationFilter hinzu http.addFilterBefore(new JWTAuthenticationFilter(tokenAuthenticationService), UsernamePasswordAuthenticationFilter.class); - if (corsProperties.isDisbaled()) { - http.cors().disable(); - } - return http.build(); } @@ -57,7 +67,7 @@ public CorsFilter corsFilter() { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); Arrays.stream(corsProperties.getAllowedOrigins()).forEach(config::addAllowedOrigin); - config.addAllowedHeader(corsProperties.getAllowedHeaders()); + Arrays.asList(corsProperties.getAllowedHeaders()).forEach(config::addAllowedHeader); Arrays.stream(corsProperties.getAllowedMethods()).forEach(config::addAllowedMethod); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); @@ -65,17 +75,4 @@ public CorsFilter corsFilter() { return new CorsFilter(source); } - - - @Bean - public WebSecurityCustomizer customize() { - return (web) -> web.ignoring().requestMatchers( - "/v2/api-docs", - "/swagger-resources", - "/swagger-resources/configuration/ui", - "/swagger-resources/configuration/security", - "/swagger-ui.html", - "/webjars/**" - ); - } } diff --git a/sts-secret-server/src/main/resources/application.yml b/sts-secret-server/src/main/resources/application.yml index f8dc4900..c2f3b80d 100644 --- a/sts-secret-server/src/main/resources/application.yml +++ b/sts-secret-server/src/main/resources/application.yml @@ -10,13 +10,14 @@ spring: password: db_user@123 jpa: show-sql: false + open-in-view: false properties: hibernate: default_schema: sts flyway: enabled: false locations: - - db/migration/flyway/h2 + - db/migration/flyway/h2 liquibase: enabled: true change-log: classpath:/db/migration/liquibase/changelog.yml @@ -26,10 +27,11 @@ spring: - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration - org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration +#Example values, do not use for production cors: disabled: false - allowedOrigins: "*" - allowedHeaders: "*" + allowedOrigins: localhost:8080, localhost:8081 + allowedHeaders: Content-Type,Authorization,Accept,Origin,Referer,User-Agent allowedMethods: GET,POST,PUT,DELETE sts: diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index d69b8ff2..020bb609 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index a617e0a8..683ed467 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index ba082f55..58f35a9e 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 16a94e79..13ffc8b4 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 5c164b24..0bb1b7a6 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 968a1db1..cab132e0 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 diff --git a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java index f250344e..95edd501 100644 --- a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java +++ b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java @@ -95,7 +95,7 @@ protected void onJsonWebKeySetRetrieved(List jwks) { log.info("Retrieved {} keys from {}", jwks.size(), jwksUrl); } - public static class JsonWebKeyRetrievalException extends RuntimeException { + protected static class JsonWebKeyRetrievalException extends RuntimeException { public JsonWebKeyRetrievalException(Throwable cause) { super(cause); } diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 0f14d7f2..b4fe429e 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.15 + 1.1.19 4.0.0 From 19a16c6e32a6c7335e8e5e9c8884b2838cdf20c6 Mon Sep 17 00:00:00 2001 From: Mme-adorsys <107761361+Mme-adorsys@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:56:52 +0400 Subject: [PATCH 35/37] Logs for error analyses (#167) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Increased version to 1.1.16 * Changed cors configuration to set disabled first to prevent cors configuration exceptions * Updated version to 1.17 * Replaced deprecated PostgreSQL94Dialect with PostgreSQLDialect * spring.jpa.open-in-view ist standardmäßig aktiviert: behoben * Excluded SecurityAutoConfiguration to prevent Spring from creating a default user * Changed SecurityConfiguration to allow access to swagger * Changed SecurityConfiguration to allow access to swagger * Excluded AutoConfiguration for UserDetailsService * Added RequestMatchers to address warnings for ignored paths * Increased version to 1.19 * Added logs for refreshing cache to see if there is a concurrent call to update cache which leads to sequence errors * Added logs for refreshing cache to see if there is a concurrent call to update cache which leads to sequence errors * Added logs for refreshing cache to see if there is a concurrent call to update cache which leads to sequence errors * Added logs for refreshing cache to see if there is a concurrent call to update cache which leads to sequence errors --- .../persistence/CachedKeyStoreRepository.java | 26 ++++++++++++++++--- .../adorsys/sts/ApplicationEventListener.java | 24 +++++++++++++++++ .../KeyManagementConfiguration.java | 3 +++ .../de/adorsys/sts/tokenauth/AuthServer.java | 15 +++++++++++ 4 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 sts-spring/src/main/java/de/adorsys/sts/ApplicationEventListener.java diff --git a/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/persistence/CachedKeyStoreRepository.java b/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/persistence/CachedKeyStoreRepository.java index e87637c1..4fbc0b7d 100644 --- a/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/persistence/CachedKeyStoreRepository.java +++ b/sts-keymanagement/sts-keymanagement-impl/src/main/java/de/adorsys/sts/keymanagement/persistence/CachedKeyStoreRepository.java @@ -1,9 +1,11 @@ package de.adorsys.sts.keymanagement.persistence; import de.adorsys.sts.keymanagement.model.StsKeyStore; +import lombok.extern.slf4j.Slf4j; import java.time.ZonedDateTime; +@Slf4j public class CachedKeyStoreRepository implements KeyStoreRepository { private final KeyStoreRepository keyStoreRepository; @@ -15,33 +17,49 @@ public CachedKeyStoreRepository(KeyStoreRepository keyStoreRepository) { @Override public StsKeyStore load() { - if(cachedKeyStore == null) { + log.debug("Calling load(). Cached key store last update: {}", cachedKeyStore != null ? cachedKeyStore.getLastUpdate() : null); + + if (cachedKeyStore == null) { + log.debug("Cache is null, loading from repository"); cachedKeyStore = keyStoreRepository.load(); } else { ZonedDateTime lastUpdate = keyStoreRepository.lastUpdate(); ZonedDateTime cachedLastUpdate = cachedKeyStore.getLastUpdate(); - if(lastUpdate.isAfter(cachedLastUpdate)) { + if (lastUpdate.isAfter(cachedLastUpdate)) { + log.debug("Repository was updated more recently than cache. Refreshing cache."); cachedKeyStore = keyStoreRepository.load(); } } + log.debug("Returning cached key store with last update: {}", cachedKeyStore != null ? cachedKeyStore.getLastUpdate() : null); return cachedKeyStore; } @Override public boolean exists() { - return cachedKeyStore != null || keyStoreRepository.exists(); + boolean exists = cachedKeyStore != null || keyStoreRepository.exists(); + + log.debug("Checking if KeyStore exists. Result: {}", exists); + + return exists; } @Override public void save(StsKeyStore keyStore) { + log.debug("Saving keyStore to repository..."); keyStoreRepository.save(keyStore); + + log.debug("Updating cache with newly saved keyStore"); cachedKeyStore = keyStore; } @Override public ZonedDateTime lastUpdate() { - return keyStoreRepository.lastUpdate(); + ZonedDateTime lastUpdate = keyStoreRepository.lastUpdate(); + + log.debug("LastUpdate: {}", lastUpdate); + + return lastUpdate; } } diff --git a/sts-spring/src/main/java/de/adorsys/sts/ApplicationEventListener.java b/sts-spring/src/main/java/de/adorsys/sts/ApplicationEventListener.java new file mode 100644 index 00000000..aa93a2f7 --- /dev/null +++ b/sts-spring/src/main/java/de/adorsys/sts/ApplicationEventListener.java @@ -0,0 +1,24 @@ +package de.adorsys.sts; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.context.event.EventListener; +import org.springframework.stereotype.Component; + +@Component +public class ApplicationEventListener { + + private static final Logger log = LoggerFactory.getLogger(ApplicationEventListener.class); + + @EventListener(ApplicationReadyEvent.class) + public void applicationReadyEvent() { + log.info("Application started"); + } + + @EventListener(ContextClosedEvent.class) + public void contextClosedEvent() { + log.info("Application stopped"); + } +} diff --git a/sts-spring/src/main/java/de/adorsys/sts/keymanagement/KeyManagementConfiguration.java b/sts-spring/src/main/java/de/adorsys/sts/keymanagement/KeyManagementConfiguration.java index e0cf6a9e..59d2f9a1 100644 --- a/sts-spring/src/main/java/de/adorsys/sts/keymanagement/KeyManagementConfiguration.java +++ b/sts-spring/src/main/java/de/adorsys/sts/keymanagement/KeyManagementConfiguration.java @@ -10,6 +10,7 @@ import de.adorsys.sts.keymanagement.persistence.CachedKeyStoreRepository; import de.adorsys.sts.keymanagement.persistence.KeyStoreRepository; import de.adorsys.sts.keymanagement.service.*; +import lombok.extern.slf4j.Slf4j; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; @@ -29,6 +30,7 @@ type = FilterType.REGEX ) ) +@Slf4j public class KeyManagementConfiguration { @Bean @@ -41,6 +43,7 @@ KeyConversionService keyConversionService( @Bean(name = "cached") KeyStoreRepository cachedKeyStoreRepository(KeyStoreRepository keyStoreRepository) { + log.debug("Creating 'cached' KeyStoreRepository bean..."); return new CachedKeyStoreRepository(keyStoreRepository); } diff --git a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java index 95edd501..d1dab3b0 100644 --- a/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java +++ b/sts-token-auth/src/main/java/de/adorsys/sts/tokenauth/AuthServer.java @@ -48,6 +48,8 @@ public AuthServer(String name, String issUrl, String jwksUrl, int refreshInterva } private void updateJwkCache() throws JsonWebKeyRetrievalException { + log.debug("Thread entering updateJwkCache: " + Thread.currentThread().getId()); + try { List jwks = jwkSource.get(new JWKSelector(new JWKMatcher.Builder().build()), null); @@ -62,31 +64,44 @@ private void updateJwkCache() throws JsonWebKeyRetrievalException { } catch (Exception e) { throw new JsonWebKeyRetrievalException(e); } + + log.debug("Thread leaving updateJwkCache: " + Thread.currentThread().getId()); } public Key getJWK(String keyID) throws JsonWebKeyRetrievalException { + log.debug("Thread entering getJWK: {}", Thread.currentThread().getId()); + Date now = new Date(); long currentTime = now.getTime(); // Check if the cache is still valid if (currentTime - lastCacheUpdate > refreshIntervalSeconds * 1000L || jwkCache.isEmpty()) { + log.debug("Cache is invalid or empty, updating the cache..."); updateJwkCache(); + log.debug("Cache updated successfully"); } JWK jwk = jwkCache.get(keyID); if (jwk == null) { + log.error("Key with ID {} not found in cache", keyID); throw new JsonWebKeyRetrievalException("Key with ID " + keyID + " not found in cache"); } + log.debug("JWK for key ID {} found in cache", keyID); + if (jwk instanceof RSAKey) { try { + log.debug("JWK is instance of RSAKey"); return ((RSAKey) jwk).toPublicKey(); } catch (JOSEException e) { + log.error("Error while converting RSAKey to public key", e); throw new JsonWebKeyRetrievalException(e); } } else if (jwk instanceof SecretJWK) { + log.debug("JWK is instance of SecretJWK"); return ((SecretJWK) jwk).toSecretKey(); } else { + log.error("Unknown key type {}", jwk.getClass()); throw new JsonWebKeyRetrievalException("unknown key type " + jwk.getClass()); } } From 7d638044e481be5d565c49cac57a14aba74919c3 Mon Sep 17 00:00:00 2001 From: Maxim Grischenko Date: Mon, 12 Feb 2024 14:38:23 +0100 Subject: [PATCH 36/37] update workflow to java 17 (#168) * update workflow to java 17 * Start next iteration with 1.1.20-SNAPSHOT * update maven plugin versions --- .github/workflows/pull-requests.yml | 19 ++++----- .github/workflows/push-in-develop.yml | 19 ++++++--- .github/workflows/push-with-v-tag.yml | 15 +++++-- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 40 +++++++++---------- scripts/mvn_deploy.sh | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- .../sts-keymanagement-api/pom.xml | 2 +- .../sts-keymanagement-impl/pom.xml | 3 +- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 23 files changed, 71 insertions(+), 61 deletions(-) diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml index b4801daa..af13c80b 100644 --- a/.github/workflows/pull-requests.yml +++ b/.github/workflows/pull-requests.yml @@ -7,19 +7,20 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v2 + - name: Step 1 - Checkout repository code + uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v2 + - name: Step 2 - Set up JDK 17 + uses: actions/setup-java@v4 with: - distribution: 'adopt' java-version: '17' + distribution: 'temurin' + cache: 'maven' - - name: Maven build and test - run: mvn clean verify -B -V + - name: Step 3 - Build & Test + run: mvn clean verify -ntp - - name: Build client + - name: Step 4 - Build client run: ./scripts/build_client.sh diff --git a/.github/workflows/push-in-develop.yml b/.github/workflows/push-in-develop.yml index ab96ebc9..f45991d1 100644 --- a/.github/workflows/push-in-develop.yml +++ b/.github/workflows/push-in-develop.yml @@ -6,15 +6,22 @@ on: jobs: Develop-Branch-Build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v2 + - name: Step 1 - Checkout repository code + uses: actions/checkout@v4 - - name: Maven build and test - run: mvn clean verify -B -V + - name: Step 2 - Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' - - name: Build client + - name: Step 3 - Build & Test + run: mvn clean verify -ntp + + - name: Step 5 - Build client run: ./scripts/build_client.sh - name: Maven deploy snapshot diff --git a/.github/workflows/push-with-v-tag.yml b/.github/workflows/push-with-v-tag.yml index 710e2516..e5f60f03 100644 --- a/.github/workflows/push-with-v-tag.yml +++ b/.github/workflows/push-with-v-tag.yml @@ -6,12 +6,19 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - name: Check out repository code - uses: actions/checkout@v2 + - name: Step 1 - Checkout repository code + uses: actions/checkout@v4 - - name: deploy to Maven + - name: Step 2 - Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Step 3 - deploy to Maven run: ./scripts/mvn_deploy.sh env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index 31547b11..b37e58c2 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.19 + 1.1.20-SNAPSHOT keycloak-storage-provider diff --git a/pom.xml b/pom.xml index 6fcd15aa..e37ad028 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.19 + 1.1.20-SNAPSHOT pom SecureTokenService @@ -65,6 +65,14 @@ 1.17.6 9.31 + 1.6.13 + 3.3.0 + 3.0.1 + 3.3.0 + 3.2.0 + 3.1.1 + 3.1.0 + 3.6.0 @@ -441,7 +449,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + ${maven-javadoc-plugin.version} ${project.build.sourceEncoding} ${project.build.sourceEncoding} @@ -451,7 +459,7 @@ maven-release-plugin - 3.0.0-M1 + ${maven-release-plugin.version} release true @@ -468,7 +476,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + ${maven-jar-plugin.version} @@ -492,7 +500,7 @@ org.codehaus.mojo buildnumber-maven-plugin - 1.4 + ${buildnumber-maven-plugin.version} validate @@ -531,7 +539,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + ${maven-deploy-plugin.version} true @@ -539,20 +547,18 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + ${nexus-staging-maven-plugin.version} true sonatype https://oss.sonatype.org/ true - true - 30 org.apache.maven.plugins maven-source-plugin - 3.2.1 + ${maven-source-plugin.version} attach-sources @@ -565,13 +571,8 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + ${maven-gpg-plugin.version} - opensource@adorsys.de - - --pinentry-mode - loopback - @@ -580,18 +581,13 @@ sign - - - --pinentry-mode - loopback - - org.apache.maven.plugins maven-javadoc-plugin + ${maven-javadoc-plugin.version} 17 none diff --git a/scripts/mvn_deploy.sh b/scripts/mvn_deploy.sh index 0df07a6f..fd0932f8 100755 --- a/scripts/mvn_deploy.sh +++ b/scripts/mvn_deploy.sh @@ -5,4 +5,4 @@ set -e echo "$GPG_SECRET_KEY" | base64 --decode | $GPG_EXECUTABLE --import --no-tty --batch --yes || true echo "$GPG_OWNERTRUST" | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --no-tty --batch --yes || true -mvn --no-transfer-progress --settings scripts/settings.xml package gpg:sign deploy -Prelease -DskipTests -B -U || exit 1 +mvn clean deploy -ntp --settings scripts/settings.xml gpg:sign -Prelease -DskipTests -U || exit 1 diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 231a87f7..726fc47c 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.19 + 1.1.20-SNAPSHOT sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index bfc46dce..ce36eab7 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 40edfbad..4ee68daf 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index b7baf071..57c4da0e 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 15c0ccaf..854dca24 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 @@ -14,7 +14,6 @@ de.adorsys.sts sts-keymanagement-api - 1.1.19 de.adorsys.sts diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index eae67aa3..5ff7a498 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index e8560885..e657e86c 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index 2df08154..a2312fa0 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index cf798d6d..1d44ca31 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index 70bc10d0..fbf5a8a7 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index 020bb609..e6957674 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 683ed467..00d8b1cf 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index 58f35a9e..c2b5dfad 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 13ffc8b4..0ced4766 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 0bb1b7a6..7bff9f92 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index cab132e0..6c527cb2 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index b4fe429e..75af0cca 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.19 + 1.1.20-SNAPSHOT 4.0.0 From ad02635497d49b6f66763ca0a5d8eb746e11bd38 Mon Sep 17 00:00:00 2001 From: Maxim Grischenko Date: Mon, 12 Feb 2024 14:41:24 +0100 Subject: [PATCH 37/37] [release] Prepare release 1.1.20 --- keycloak-storage-provider/pom.xml | 2 +- pom.xml | 2 +- sts-client-example/package-lock.json | 2 +- sts-client-example/package.json | 2 +- sts-common/pom.xml | 2 +- sts-example/pom.xml | 2 +- sts-keymanagement/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-api/pom.xml | 2 +- sts-keymanagement/sts-keymanagement-impl/pom.xml | 2 +- sts-persistence-jpa/pom.xml | 2 +- sts-persistence-mongo/pom.xml | 2 +- sts-pop/pom.xml | 2 +- sts-resource-server/pom.xml | 2 +- sts-secret-server/pom.xml | 2 +- sts-secret/pom.xml | 2 +- sts-server-info/pom.xml | 2 +- sts-service-component-example/pom.xml | 2 +- sts-simple-encryption/pom.xml | 2 +- sts-spring/pom.xml | 2 +- sts-token-auth/pom.xml | 2 +- sts-token/pom.xml | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/keycloak-storage-provider/pom.xml b/keycloak-storage-provider/pom.xml index b37e58c2..dad5991e 100644 --- a/keycloak-storage-provider/pom.xml +++ b/keycloak-storage-provider/pom.xml @@ -6,7 +6,7 @@ de.adorsys.sts secure-token-service - 1.1.20-SNAPSHOT + 1.1.20 keycloak-storage-provider diff --git a/pom.xml b/pom.xml index e37ad028..d480dbed 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.20-SNAPSHOT + 1.1.20 pom SecureTokenService diff --git a/sts-client-example/package-lock.json b/sts-client-example/package-lock.json index c1b296d5..8addc63f 100644 --- a/sts-client-example/package-lock.json +++ b/sts-client-example/package-lock.json @@ -1,6 +1,6 @@ { "name": "sts-client-example", - "version": "1.1.0-SNAPSHOT", + "version": "1.1.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/sts-client-example/package.json b/sts-client-example/package.json index b62b3547..49217b83 100644 --- a/sts-client-example/package.json +++ b/sts-client-example/package.json @@ -1,6 +1,6 @@ { "name": "sts-client-example", - "version": "1.1.0-SNAPSHOT", + "version": "1.1.20", "license": "MIT", "scripts": { "ng": "npx ng ", diff --git a/sts-common/pom.xml b/sts-common/pom.xml index 726fc47c..836e2909 100644 --- a/sts-common/pom.xml +++ b/sts-common/pom.xml @@ -5,7 +5,7 @@ de.adorsys.sts secure-token-service - 1.1.20-SNAPSHOT + 1.1.20 sts-common diff --git a/sts-example/pom.xml b/sts-example/pom.xml index ce36eab7..7e66befa 100644 --- a/sts-example/pom.xml +++ b/sts-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-keymanagement/pom.xml b/sts-keymanagement/pom.xml index 4ee68daf..166f14fd 100644 --- a/sts-keymanagement/pom.xml +++ b/sts-keymanagement/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-api/pom.xml b/sts-keymanagement/sts-keymanagement-api/pom.xml index 57c4da0e..66f37300 100644 --- a/sts-keymanagement/sts-keymanagement-api/pom.xml +++ b/sts-keymanagement/sts-keymanagement-api/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-keymanagement/sts-keymanagement-impl/pom.xml b/sts-keymanagement/sts-keymanagement-impl/pom.xml index 854dca24..00a1ded6 100644 --- a/sts-keymanagement/sts-keymanagement-impl/pom.xml +++ b/sts-keymanagement/sts-keymanagement-impl/pom.xml @@ -5,7 +5,7 @@ sts-keymanagement de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-persistence-jpa/pom.xml b/sts-persistence-jpa/pom.xml index 5ff7a498..9a66a56c 100644 --- a/sts-persistence-jpa/pom.xml +++ b/sts-persistence-jpa/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-persistence-mongo/pom.xml b/sts-persistence-mongo/pom.xml index e657e86c..495ad3a0 100644 --- a/sts-persistence-mongo/pom.xml +++ b/sts-persistence-mongo/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-pop/pom.xml b/sts-pop/pom.xml index a2312fa0..2375a527 100644 --- a/sts-pop/pom.xml +++ b/sts-pop/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-resource-server/pom.xml b/sts-resource-server/pom.xml index 1d44ca31..4a8b1282 100644 --- a/sts-resource-server/pom.xml +++ b/sts-resource-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-secret-server/pom.xml b/sts-secret-server/pom.xml index fbf5a8a7..16e050ee 100644 --- a/sts-secret-server/pom.xml +++ b/sts-secret-server/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 diff --git a/sts-secret/pom.xml b/sts-secret/pom.xml index e6957674..77975ed5 100644 --- a/sts-secret/pom.xml +++ b/sts-secret/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-server-info/pom.xml b/sts-server-info/pom.xml index 00d8b1cf..dd38a9da 100644 --- a/sts-server-info/pom.xml +++ b/sts-server-info/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-service-component-example/pom.xml b/sts-service-component-example/pom.xml index c2b5dfad..58d539af 100644 --- a/sts-service-component-example/pom.xml +++ b/sts-service-component-example/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-simple-encryption/pom.xml b/sts-simple-encryption/pom.xml index 0ced4766..510ee884 100644 --- a/sts-simple-encryption/pom.xml +++ b/sts-simple-encryption/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-spring/pom.xml b/sts-spring/pom.xml index 7bff9f92..355fc0b8 100644 --- a/sts-spring/pom.xml +++ b/sts-spring/pom.xml @@ -3,7 +3,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-token-auth/pom.xml b/sts-token-auth/pom.xml index 6c527cb2..ae386a46 100644 --- a/sts-token-auth/pom.xml +++ b/sts-token-auth/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0 diff --git a/sts-token/pom.xml b/sts-token/pom.xml index 75af0cca..9185266f 100644 --- a/sts-token/pom.xml +++ b/sts-token/pom.xml @@ -5,7 +5,7 @@ secure-token-service de.adorsys.sts - 1.1.20-SNAPSHOT + 1.1.20 4.0.0