From b6afd25441faa313d6453f259e1ba2f28407daab Mon Sep 17 00:00:00 2001 From: MDSBarbosa Date: Thu, 4 Sep 2025 16:12:37 +0100 Subject: [PATCH] fix: create JtiValidationPostgresqlMigrationExtension extension --- ...alidationPostgresqlMigrationExtension.java | 34 +++++++++++++++++++ ...rg.eclipse.edc.spi.system.ServiceExtension | 1 + ..._1__Init_JtiValidation_Database_Schema.sql | 24 +++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 edc-extensions/migrations/control-plane-migration/src/main/java/org/eclipse/tractusx/edc/postgresql/migration/JtiValidationPostgresqlMigrationExtension.java create mode 100644 edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/jti-validation/V0_0_1__Init_JtiValidation_Database_Schema.sql diff --git a/edc-extensions/migrations/control-plane-migration/src/main/java/org/eclipse/tractusx/edc/postgresql/migration/JtiValidationPostgresqlMigrationExtension.java b/edc-extensions/migrations/control-plane-migration/src/main/java/org/eclipse/tractusx/edc/postgresql/migration/JtiValidationPostgresqlMigrationExtension.java new file mode 100644 index 0000000000..f3f875fc48 --- /dev/null +++ b/edc-extensions/migrations/control-plane-migration/src/main/java/org/eclipse/tractusx/edc/postgresql/migration/JtiValidationPostgresqlMigrationExtension.java @@ -0,0 +1,34 @@ +/******************************************************************************** + * Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ + +package org.eclipse.tractusx.edc.postgresql.migration; + +public class JtiValidationPostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension { + private static final String NAME_SUBSYSTEM = "jti-validation"; + + @Override + protected String getSubsystemName() { + return NAME_SUBSYSTEM; + } + + @Override + protected String getMigrationSubsystem() { + return NAME_SUBSYSTEM; + } +} diff --git a/edc-extensions/migrations/control-plane-migration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension b/edc-extensions/migrations/control-plane-migration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension index 8af39ce0a5..0794d6e67d 100644 --- a/edc-extensions/migrations/control-plane-migration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension +++ b/edc-extensions/migrations/control-plane-migration/src/main/resources/META-INF/services/org.eclipse.edc.spi.system.ServiceExtension @@ -27,6 +27,7 @@ org.eclipse.tractusx.edc.postgresql.migration.ContractNegotiationPostgresqlMigra org.eclipse.tractusx.edc.postgresql.migration.DataPlaneInstancePostgresqlMigrationExtension org.eclipse.tractusx.edc.postgresql.migration.EdrIndexPostgresqlMigrationExtension org.eclipse.tractusx.edc.postgresql.migration.FederatedCatalogCacheMigrationExtension +org.eclipse.tractusx.edc.postgresql.migration.JtiValidationPostgresqlMigrationExtension org.eclipse.tractusx.edc.postgresql.migration.PolicyMonitorPostgresqlMigrationExtension org.eclipse.tractusx.edc.postgresql.migration.PolicyPostgresqlMigrationExtension org.eclipse.tractusx.edc.postgresql.migration.TransferProcessPostgresqlMigrationExtension diff --git a/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/jti-validation/V0_0_1__Init_JtiValidation_Database_Schema.sql b/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/jti-validation/V0_0_1__Init_JtiValidation_Database_Schema.sql new file mode 100644 index 0000000000..7a19bc0430 --- /dev/null +++ b/edc-extensions/migrations/control-plane-migration/src/main/resources/org/eclipse/tractusx/edc/postgresql/migration/jti-validation/V0_0_1__Init_JtiValidation_Database_Schema.sql @@ -0,0 +1,24 @@ +-- +-- Copyright (c) 2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +-- +-- This program and the accompanying materials are made available under the +-- terms of the Apache License, Version 2.0 which is available at +-- https://www.apache.org/licenses/LICENSE-2.0 +-- +-- SPDX-License-Identifier: Apache-2.0 +-- +-- Contributors: +-- Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation +-- + +-- +-- table: edc_jti_validation +-- + +CREATE TABLE IF NOT EXISTS edc_jti_validation +( + token_id VARCHAR NOT NULL PRIMARY KEY, + expires_at BIGINT -- expiry time in epoch millis +); + +