diff --git a/hawkbit-artifact/hawkbit-artifact-api/pom.xml b/hawkbit-artifact/hawkbit-artifact-api/pom.xml index 9a1df1009..7e07f6687 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/pom.xml +++ b/hawkbit-artifact/hawkbit-artifact-api/pom.xml @@ -22,6 +22,12 @@ hawkBit :: Artifact :: API + + org.eclipse.hawkbit + hawkbit-core + ${project.version} + + org.springframework.boot spring-boot diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/AbstractArtifactRepository.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/AbstractArtifactRepository.java similarity index 95% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/AbstractArtifactRepository.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/AbstractArtifactRepository.java index c6e0d8e5a..5f4ad8653 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/AbstractArtifactRepository.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/AbstractArtifactRepository.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import java.io.BufferedOutputStream; import java.io.File; @@ -22,8 +22,10 @@ import java.security.NoSuchAlgorithmException; import java.util.HexFormat; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactStoreException; +import org.eclipse.hawkbit.repository.artifact.exception.HashNotMatchException; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; import org.springframework.util.ObjectUtils; /** diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactRepository.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactRepository.java similarity index 87% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactRepository.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactRepository.java index 14dc2a7ac..b7d829425 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactRepository.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactRepository.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,15 +7,17 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import java.io.InputStream; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactStoreException; +import org.eclipse.hawkbit.repository.artifact.exception.HashNotMatchException; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; /** * ArtifactRepository service interface. diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryption.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryption.java similarity index 89% rename from hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryption.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryption.java index 85728f8d9..8d576ab56 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryption.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryption.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,13 +7,13 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.repository; +package org.eclipse.hawkbit.repository.artifact.encryption; import java.io.InputStream; import java.util.Map; import java.util.Set; -import org.eclipse.hawkbit.repository.exception.ArtifactEncryptionFailedException; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactEncryptionFailedException; /** * Interface definition for artifact encryption. diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionSecretsStore.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionSecretsStore.java new file mode 100644 index 000000000..c1e62572a --- /dev/null +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionSecretsStore.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2025 Contributors to the Eclipse Foundation + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.hawkbit.repository.artifact.encryption; + +import java.util.Optional; + +/** + * Interface definition for artifact encryption secrets store. It maintains secret key/value pairs + * identified by id (e.g. software module id) + */ +public interface ArtifactEncryptionSecretsStore { + + /** + * Adds secret key/value pair associated with particular id (e.g. software module id) to the store. + * + * @param id id of the secret + * @param secretKey key of the secret + * @param secretValue value of the secret + */ + void addSecret(final long id, final String secretKey, final String secretValue); + + /** + * Checks if secret is present for particular id and key in the store. + * + * @param id id of the secret + * @param secretKey key of the secret + */ + boolean secretExists(final long id, final String secretKey); + + /** + * Retrieves secret value associated with particular id and key from the store. + * + * @param id id of the secret + * @param secretKey key of the secret + */ + Optional getSecret(final long id, final String secretKey); + + /** + * Removes secret key/value pair associated with particular id from the store. + * + * @param id id of the secret + * @param secretKey key of the secret + */ + void removeSecret(final long id, final String secretKey); +} \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionService.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionService.java similarity index 67% rename from hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionService.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionService.java index 807d51221..5e76fe06c 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionService.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionService.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.repository; +package org.eclipse.hawkbit.repository.artifact.encryption; import java.io.InputStream; import java.util.HashMap; @@ -17,11 +17,12 @@ import java.util.Set; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.eclipse.hawkbit.repository.exception.ArtifactEncryptionUnsupportedException; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactEncryptionUnsupportedException; import org.springframework.beans.factory.annotation.Autowired; /** - * Service responsible for encryption operations. + * Service responsible for encryption operations. Should be registered as a bean in order its autowired dependencies + * to be injected. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) @SuppressWarnings("java:S6548") // singleton holder ensures static access to spring resources in some places @@ -59,51 +60,64 @@ public final class ArtifactEncryptionService { } /** - * Generates encryption secrets and saves them in secret store by software module id reference. + * Generates encryption secrets and saves them in secret store by id reference. * - * @param smId software module id + * @param id id of the secrets to be generated */ - public void addSoftwareModuleEncryptionSecrets(final long smId) { + public void addEncryptionSecrets(final long id) { if (!isEncryptionSupported()) { throw new ArtifactEncryptionUnsupportedException("Encryption secrets generation is not supported."); } final Map secrets = artifactEncryption.generateSecrets(); - secrets.forEach((key, value) -> artifactEncryptionSecretsStore.addSecret(smId, key, value)); - // we want to clear secrets from memory as soon as possible - secrets.clear(); + try { + secrets.forEach((key, value) -> artifactEncryptionSecretsStore.addSecret(id, key, value)); + } finally { + // clear secrets from memory as soon as possible + secrets.clear(); + } } /** - * Encrypts artifact stream using the keys retrieved from secrets store by - * software module id reference. + * Encrypts artifact stream using the keys retrieved from secrets store by id reference. * - * @param smId software module id + * @param id id of the secrets * @param artifactStream artifact stream to encrypt * @return encrypted input stream */ - public InputStream encryptSoftwareModuleArtifact(final long smId, final InputStream artifactStream) { + public InputStream encryptArtifact(final long id, final InputStream artifactStream) { if (!isEncryptionSupported()) { throw new ArtifactEncryptionUnsupportedException("Artifact encryption is not supported."); } - return artifactEncryption.encryptStream(getSoftwareModuleEncryptionSecrets(smId), artifactStream); + final Map secrets = getEncryptionSecrets(id); + try { + return artifactEncryption.encryptStream(secrets, artifactStream); + } finally { + // clear secrets from memory as soon as possible + secrets.clear(); + } } /** - * Decrypts artifact stream using the keys retrieved from secrets store by - * software module id reference. + * Decrypts artifact stream using the keys retrieved from secrets store by id reference. * - * @param smId software module id + * @param id id of the secrets * @param encryptedArtifactStream artifact stream to decrypt * @return decrypted input stream */ - public InputStream decryptSoftwareModuleArtifact(final long smId, final InputStream encryptedArtifactStream) { + public InputStream decryptArtifact(final long id, final InputStream encryptedArtifactStream) { if (!isEncryptionSupported()) { throw new ArtifactEncryptionUnsupportedException("Artifact decryption is not supported."); } - return artifactEncryption.decryptStream(getSoftwareModuleEncryptionSecrets(smId), encryptedArtifactStream); + final var secrets = getEncryptionSecrets(id); + try { + return artifactEncryption.decryptStream(secrets, encryptedArtifactStream); + } finally { + // clear secrets from memory as soon as possible + secrets.clear(); + } } /** @@ -115,12 +129,11 @@ public final class ArtifactEncryptionService { return artifactEncryption.encryptionSizeOverhead(); } - private Map getSoftwareModuleEncryptionSecrets(final long smId) { + private Map getEncryptionSecrets(final long id) { final Set requiredSecretsKeys = artifactEncryption.requiredSecretKeys(); final Map requiredSecrets = new HashMap<>(); for (final String requiredSecretsKey : requiredSecretsKeys) { - final Optional requiredSecretsValue = artifactEncryptionSecretsStore.getSecret(smId, - requiredSecretsKey); + final Optional requiredSecretsValue = artifactEncryptionSecretsStore.getSecret(id, requiredSecretsKey); requiredSecretsValue.ifPresent(secretValue -> requiredSecrets.put(requiredSecretsKey, secretValue)); } return requiredSecrets; diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionFailedException.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionFailedException.java similarity index 92% rename from hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionFailedException.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionFailedException.java index 8c6524cb2..edc8150ee 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionFailedException.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionFailedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.repository.exception; +package org.eclipse.hawkbit.repository.artifact.exception; import java.io.Serial; @@ -25,6 +25,13 @@ public final class ArtifactEncryptionFailedException extends AbstractServerRtExc @Serial private static final long serialVersionUID = 1L; + /** + * Encryption operation that caused the exception. + */ + public enum EncryptionOperation { + GENERATE_SECRETS, ENCRYPT, DECRYPT; + } + @Getter private final EncryptionOperation encryptionOperation; @@ -40,11 +47,4 @@ public final class ArtifactEncryptionFailedException extends AbstractServerRtExc super(message, SpServerError.SP_ARTIFACT_ENCRYPTION_FAILED, cause); this.encryptionOperation = encryptionOperation; } - - /** - * Encryption operation that caused the exception. - */ - public enum EncryptionOperation { - GENERATE_SECRETS, ENCRYPT, DECRYPT; - } } \ No newline at end of file diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionUnsupportedException.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionUnsupportedException.java similarity index 89% rename from hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionUnsupportedException.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionUnsupportedException.java index f8476f5b9..ea2c2c76b 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/exception/ArtifactEncryptionUnsupportedException.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactEncryptionUnsupportedException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.repository.exception; +package org.eclipse.hawkbit.repository.artifact.exception; import java.io.Serial; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStoreException.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactStoreException.java similarity index 86% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStoreException.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactStoreException.java index 9074bcc61..5d4e5dc0e 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactStoreException.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/ArtifactStoreException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact.exception; import java.io.Serial; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/HashNotMatchException.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/HashNotMatchException.java similarity index 90% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/HashNotMatchException.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/HashNotMatchException.java index c1d462fca..21da96e50 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/HashNotMatchException.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/exception/HashNotMatchException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact.exception; import java.io.Serial; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/AbstractDbArtifact.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/AbstractDbArtifact.java similarity index 88% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/AbstractDbArtifact.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/AbstractDbArtifact.java index d0a981b00..9229e163b 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/AbstractDbArtifact.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/AbstractDbArtifact.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.model; +package org.eclipse.hawkbit.repository.artifact.model; import java.util.Objects; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifact.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifact.java similarity index 89% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifact.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifact.java index 993b5a157..166162d14 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifact.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifact.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.model; +package org.eclipse.hawkbit.repository.artifact.model; import java.io.InputStream; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifactHash.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifactHash.java similarity index 86% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifactHash.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifactHash.java index ff3336081..17a5e8f67 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/model/DbArtifactHash.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/model/DbArtifactHash.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.model; +package org.eclipse.hawkbit.repository.artifact.model; import lombok.Data; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ApiType.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ApiType.java similarity index 80% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ApiType.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ApiType.java index 72983b6ef..6ff9589db 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ApiType.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ApiType.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; /** * hawkBit API type. diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrl.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrl.java similarity index 86% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrl.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrl.java index 8f10fa7ac..c7332dac0 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrl.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrl.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import lombok.Data; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandler.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandler.java similarity index 91% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandler.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandler.java index 5f438b619..940d32acc 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandler.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import java.net.URI; import java.util.List; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandlerProperties.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandlerProperties.java similarity index 95% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandlerProperties.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandlerProperties.java index afc370abe..1be88147c 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/ArtifactUrlHandlerProperties.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/ArtifactUrlHandlerProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import java.util.Arrays; import java.util.Collections; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62Util.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62Util.java similarity index 93% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62Util.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62Util.java index bb31874f3..b86416a1b 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62Util.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62Util.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandler.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandler.java similarity index 98% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandler.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandler.java index 80a9d9e6f..eb67562bd 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandler.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandler.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import java.net.URI; import java.net.URLEncoder; @@ -20,7 +20,7 @@ import java.util.Map.Entry; import java.util.Optional; import java.util.Set; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholder.java b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholder.java similarity index 94% rename from hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholder.java rename to hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholder.java index d7545e1f6..940540bc1 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholder.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import lombok.Data; diff --git a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionServiceTest.java similarity index 79% rename from hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java rename to hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionServiceTest.java index c7257299b..081ee5078 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/test/java/org/eclipse/hawkbit/repository/ArtifactEncryptionServiceTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/encryption/ArtifactEncryptionServiceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,12 +7,12 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.repository; +package org.eclipse.hawkbit.repository.artifact.encryption; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.eclipse.hawkbit.repository.exception.ArtifactEncryptionUnsupportedException; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactEncryptionUnsupportedException; import org.junit.jupiter.api.Test; /** @@ -33,10 +33,10 @@ class ArtifactEncryptionServiceTest { assertThat(artifactEncryptionService.isEncryptionSupported()).isFalse(); assertThatExceptionOfType(ArtifactEncryptionUnsupportedException.class) - .isThrownBy(() -> artifactEncryptionService.addSoftwareModuleEncryptionSecrets(1L)); + .isThrownBy(() -> artifactEncryptionService.addEncryptionSecrets(1L)); assertThatExceptionOfType(ArtifactEncryptionUnsupportedException.class) - .isThrownBy(() -> artifactEncryptionService.encryptSoftwareModuleArtifact(1L, null)); + .isThrownBy(() -> artifactEncryptionService.encryptArtifact(1L, null)); assertThatExceptionOfType(ArtifactEncryptionUnsupportedException.class) - .isThrownBy(() -> artifactEncryptionService.decryptSoftwareModuleArtifact(1L, null)); + .isThrownBy(() -> artifactEncryptionService.decryptArtifact(1L, null)); } -} +} \ No newline at end of file diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62UtilTest.java similarity index 90% rename from hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java rename to hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62UtilTest.java index 42d3c0a39..3d2028414 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/Base62UtilTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/Base62UtilTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import static org.assertj.core.api.Assertions.assertThat; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandlerTest.java similarity index 97% rename from hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java rename to hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandlerTest.java index ba813c036..de924e19d 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/PropertyBasedArtifactUrlHandlerTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/PropertyBasedArtifactUrlHandlerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import static org.assertj.core.api.Assertions.assertThat; @@ -15,8 +15,8 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.List; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandlerProperties.UrlProtocol; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder.SoftwareData; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholderTest.java similarity index 96% rename from hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java rename to hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholderTest.java index 0fb791543..1c3833631 100644 --- a/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/artifact/repository/urlhandler/URLPlaceholderTest.java +++ b/hawkbit-artifact/hawkbit-artifact-api/src/test/java/org/eclipse/hawkbit/repository/artifact/urlhandler/URLPlaceholderTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository.urlhandler; +package org.eclipse.hawkbit.repository.artifact.urlhandler; import static org.assertj.core.api.Assertions.assertThat; diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/repository/filesystem/ArtifactFilesystemConfiguration.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/repository/filesystem/ArtifactFilesystemConfiguration.java index de6d39ea4..9b6ea0fac 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/repository/filesystem/ArtifactFilesystemConfiguration.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/repository/filesystem/ArtifactFilesystemConfiguration.java @@ -9,9 +9,9 @@ */ package org.eclipse.hawkbit.autoconfigure.artifact.repository.filesystem; -import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties; -import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemRepository; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.ArtifactFilesystemProperties; +import org.eclipse.hawkbit.repository.artifact.ArtifactFilesystemRepository; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFileNotFoundException.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFileNotFoundException.java similarity index 84% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFileNotFoundException.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFileNotFoundException.java index a456d1a69..63acf7733 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFileNotFoundException.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFileNotFoundException.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Bosch.IO GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; /** * Exception thrown in case that the artifact could not be read. diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystem.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystem.java similarity index 86% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystem.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystem.java index 6fecc7a10..0133bad22 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystem.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystem.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import java.io.BufferedInputStream; import java.io.File; @@ -19,8 +19,8 @@ import java.util.Objects; import jakarta.validation.constraints.NotNull; import lombok.EqualsAndHashCode; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; /** * {@link AbstractDbArtifact} implementation which dynamically creates a {@link FileInputStream} on calling {@link #getFileInputStream()}. diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemProperties.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemProperties.java similarity index 85% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemProperties.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemProperties.java index 2386559a5..3e3f4005a 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemProperties.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemProperties.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepository.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepository.java similarity index 94% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepository.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepository.java index c4eaea740..db015d004 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepository.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/main/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepository.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import java.io.File; import java.io.IOException; @@ -16,8 +16,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.io.FileUtils; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; import org.springframework.validation.annotation.Validated; /** diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepositoryTest.java similarity index 96% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepositoryTest.java index ce098400a..a23894020 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemRepositoryTest.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemRepositoryTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import static org.assertj.core.api.Assertions.assertThat; @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.assertj.core.api.Assertions; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemTest.java similarity index 91% rename from hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java rename to hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemTest.java index 843beb1d5..f5dae9c95 100644 --- a/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/artifact/repository/ArtifactFilesystemTest.java +++ b/hawkbit-artifact/hawkbit-artifact-repository-filesystem/src/test/java/org/eclipse/hawkbit/repository/artifact/ArtifactFilesystemTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015 Bosch Software Innovations GmbH and others + * Copyright (c) 2025 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hawkbit.artifact.repository; +package org.eclipse.hawkbit.repository.artifact; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import org.apache.commons.io.IOUtils; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; import org.junit.jupiter.api.Test; /** diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/ArtifactUrlHandlerAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/ArtifactUrlHandlerAutoConfiguration.java index c9a69914a..27cccb8cb 100644 --- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/ArtifactUrlHandlerAutoConfiguration.java +++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/artifact/ArtifactUrlHandlerAutoConfiguration.java @@ -9,9 +9,9 @@ */ package org.eclipse.hawkbit.autoconfigure.artifact; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties; -import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandlerProperties; +import org.eclipse.hawkbit.repository.artifact.urlhandler.PropertyBasedArtifactUrlHandler; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java b/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java index 6cb81a138..f05874a1d 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DataConversionHelper.java @@ -14,10 +14,10 @@ import java.util.Map; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ApiType; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder.SoftwareData; import org.eclipse.hawkbit.ddi.json.model.DdiArtifact; import org.eclipse.hawkbit.ddi.json.model.DdiArtifactHash; import org.eclipse.hawkbit.ddi.json.model.DdiAutoConfirmationState; diff --git a/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java b/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java index b3c459cf9..bf7261b5c 100644 --- a/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java +++ b/hawkbit-ddi/hawkbit-ddi-resource/src/main/java/org/eclipse/hawkbit/ddi/rest/resource/DdiRootController.java @@ -21,8 +21,8 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; import org.eclipse.hawkbit.audit.AuditLog; import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; import org.eclipse.hawkbit.ddi.json.model.DdiActionHistory; diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java index 963fe86b3..a944d64e7 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherService.java @@ -29,11 +29,11 @@ import java.util.stream.StreamSupport; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.IterableUtils; import org.apache.commons.collections4.ListUtils; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder.SoftwareData; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ApiType; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrl; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder.SoftwareData; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey; import org.eclipse.hawkbit.dmf.amqp.api.MessageType; diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DmfApiConfiguration.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DmfApiConfiguration.java index 05df8ee6b..85cd2de3a 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DmfApiConfiguration.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/DmfApiConfiguration.java @@ -18,7 +18,7 @@ import java.util.regex.Pattern; import lombok.ToString; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; import org.eclipse.hawkbit.dmf.amqp.api.AmqpSettings; import org.eclipse.hawkbit.repository.ConfirmationManagement; import org.eclipse.hawkbit.repository.ControllerManagement; diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java index 041473a2c..45bb93476 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java +++ b/hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java @@ -23,11 +23,11 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystem; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.ArtifactFilesystem; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrl; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey; import org.eclipse.hawkbit.dmf.amqp.api.MessageType; diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java index c8ede6bcd..cdaa735b3 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtDownloadArtifactResource.java @@ -13,7 +13,7 @@ import java.io.InputStream; import jakarta.servlet.http.HttpServletRequest; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; import org.eclipse.hawkbit.mgmt.rest.api.MgmtDownloadArtifactRestApi; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.SoftwareModuleManagement; diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java index 3f32a3b8d..8d0fcd566 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtSoftwareModuleResource.java @@ -21,7 +21,7 @@ import java.util.Optional; import jakarta.validation.ValidationException; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; import org.eclipse.hawkbit.audit.AuditLog; import org.eclipse.hawkbit.mgmt.json.model.PagedList; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; diff --git a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/mapper/MgmtSoftwareModuleMapper.java b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/mapper/MgmtSoftwareModuleMapper.java index 406acdc88..1973de19f 100644 --- a/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/mapper/MgmtSoftwareModuleMapper.java +++ b/hawkbit-mgmt/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/mapper/MgmtSoftwareModuleMapper.java @@ -18,10 +18,10 @@ import java.util.List; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ApiType; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrl; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandler; -import org.eclipse.hawkbit.artifact.repository.urlhandler.URLPlaceholder; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ApiType; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrl; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.urlhandler.URLPlaceholder; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifact; import org.eclipse.hawkbit.mgmt.json.model.artifact.MgmtArtifactHash; import org.eclipse.hawkbit.mgmt.json.model.softwaremodule.MgmtSoftwareModule; diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionSecretsStore.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionSecretsStore.java deleted file mode 100644 index df548eae5..000000000 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactEncryptionSecretsStore.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2021 Bosch.IO GmbH and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.eclipse.hawkbit.repository; - -import java.util.Optional; - -import org.eclipse.hawkbit.repository.model.SoftwareModule; - -/** - * Interface definition for artifact encryption secrets store. - */ -public interface ArtifactEncryptionSecretsStore { - - /** - * Adds secret key/value pair associated with particular - * {@link SoftwareModule} id to the store. - * - * @param softwareModuleId {@link SoftwareModule} id associated with the secret - * @param secretKey key of the secret - * @param secretValue value of the secret - */ - void addSecret(final long softwareModuleId, final String secretKey, final String secretValue); - - /** - * Checks if secret is present for particular {@link SoftwareModule} id and - * key in the store. - * - * @param softwareModuleId {@link SoftwareModule} id associated with the secret - * @param secretKey key of the secret - */ - boolean secretExists(final long softwareModuleId, final String secretKey); - - /** - * Retrieves secret value associated with particular {@link SoftwareModule} - * id and key from the store. - * - * @param softwareModuleId {@link SoftwareModule} id associated with the secret - * @param secretKey key of the secret - */ - Optional getSecret(final long softwareModuleId, final String secretKey); - - /** - * Removes secret key/value pair associated with particular - * {@link SoftwareModule} id from the store. - * - * @param softwareModuleId {@link SoftwareModule} id associated with the secret - * @param secretKey key of the secret - */ - void removeSecret(final long softwareModuleId, final String secretKey); -} diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactManagement.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactManagement.java index d1090907e..8f5b97274 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactManagement.java +++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/ArtifactManagement.java @@ -16,7 +16,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; import org.eclipse.hawkbit.im.authentication.SpPermission.SpringEvalExpressions; import org.eclipse.hawkbit.repository.exception.ArtifactDeleteFailedException; import org.eclipse.hawkbit.repository.exception.ArtifactUploadFailedException; diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/Artifact.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/Artifact.java index 91c40ec81..c18c38373 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/Artifact.java +++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/model/Artifact.java @@ -9,7 +9,7 @@ */ package org.eclipse.hawkbit.repository.model; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; /** * Binaries for a {@link SoftwareModule} Note: the decision which artifacts have diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/EncryptionAwareDbArtifact.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/EncryptionAwareDbArtifact.java index 4f2f74a98..8e9ee5a60 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/EncryptionAwareDbArtifact.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/EncryptionAwareDbArtifact.java @@ -12,8 +12,8 @@ package org.eclipse.hawkbit.repository.jpa; import java.io.InputStream; import java.util.function.UnaryOperator; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; /** * {@link DbArtifact} implementation that decrypts the underlying artifact diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java index 1983447dc..ae77993f4 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java @@ -20,11 +20,11 @@ import jakarta.validation.Validation; import io.micrometer.core.instrument.MeterRegistry; import org.eclipse.hawkbit.ContextAware; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; import org.eclipse.hawkbit.cache.TenancyCacheManager; -import org.eclipse.hawkbit.repository.ArtifactEncryption; -import org.eclipse.hawkbit.repository.ArtifactEncryptionSecretsStore; -import org.eclipse.hawkbit.repository.ArtifactEncryptionService; +import org.eclipse.hawkbit.repository.artifact.encryption.ArtifactEncryption; +import org.eclipse.hawkbit.repository.artifact.encryption.ArtifactEncryptionSecretsStore; +import org.eclipse.hawkbit.repository.artifact.encryption.ArtifactEncryptionService; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.BaseRepositoryTypeProvider; import org.eclipse.hawkbit.repository.ConfirmationManagement; @@ -155,7 +155,6 @@ import org.eclipse.hawkbit.repository.model.TargetType; import org.eclipse.hawkbit.repository.model.helper.SystemSecurityContextHolder; import org.eclipse.hawkbit.repository.model.helper.TenantConfigurationManagementHolder; import org.eclipse.hawkbit.repository.jpa.rsql.RsqlUtility; -import org.eclipse.hawkbit.repository.rsql.VirtualPropertyReplacer; import org.eclipse.hawkbit.security.HawkbitSecurityProperties; import org.eclipse.hawkbit.security.SecurityTokenGenerator; import org.eclipse.hawkbit.security.SystemSecurityContext; @@ -1010,9 +1009,8 @@ public class RepositoryApplicationConfiguration { } /** - * Default artifact encryption service bean that internally uses - * {@link ArtifactEncryption} and {@link ArtifactEncryptionSecretsStore} beans - * for {@link SoftwareModule} artifacts encryption/decryption + * Default artifact encryption service bean that internally uses {@link ArtifactEncryption} and + * {@link ArtifactEncryptionSecretsStore} beans for {@link SoftwareModule} artifacts encryption/decryption * * @return a {@link ArtifactEncryptionService} bean */ diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaArtifactManagement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaArtifactManagement.java index 1a00651b7..048e3263f 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaArtifactManagement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaArtifactManagement.java @@ -17,13 +17,13 @@ import jakarta.annotation.Nullable; import jakarta.persistence.EntityManager; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; -import org.eclipse.hawkbit.artifact.repository.ArtifactStoreException; -import org.eclipse.hawkbit.artifact.repository.HashNotMatchException; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; -import org.eclipse.hawkbit.repository.ArtifactEncryptionService; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactStoreException; +import org.eclipse.hawkbit.repository.artifact.exception.HashNotMatchException; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.encryption.ArtifactEncryptionService; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.QuotaManagement; import org.eclipse.hawkbit.repository.exception.ArtifactDeleteFailedException; @@ -275,7 +275,7 @@ public class JpaArtifactManagement implements ArtifactManagement { } private InputStream wrapInEncryptionStream(final long smId, final InputStream stream) { - return ArtifactEncryptionService.getInstance().encryptSoftwareModuleArtifact(smId, stream); + return ArtifactEncryptionService.getInstance().encryptArtifact(smId, stream); } private void assertArtifactQuota(final long moduleId, final int requested) { @@ -303,7 +303,7 @@ public class JpaArtifactManagement implements ArtifactManagement { } final ArtifactEncryptionService encryptionService = ArtifactEncryptionService.getInstance(); return new EncryptionAwareDbArtifact(dbArtifact, - stream -> encryptionService.decryptSoftwareModuleArtifact(softwareModuleId, stream), + stream -> encryptionService.decryptArtifact(softwareModuleId, stream), encryptionService.encryptionSizeOverhead()); } diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSoftwareModuleManagement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSoftwareModuleManagement.java index 6a178ab7b..5f03dcbe7 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSoftwareModuleManagement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSoftwareModuleManagement.java @@ -21,7 +21,7 @@ import java.util.stream.Collectors; import jakarta.persistence.EntityManager; -import org.eclipse.hawkbit.repository.ArtifactEncryptionService; +import org.eclipse.hawkbit.repository.artifact.encryption.ArtifactEncryptionService; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.QuotaManagement; import org.eclipse.hawkbit.repository.RepositoryConstants; @@ -120,7 +120,7 @@ public class JpaSoftwareModuleManagement implements SoftwareModuleManagement { entityManager.flush(); createdModules.stream().filter(SoftwareModule::isEncrypted).map(SoftwareModule::getId) .forEach(encryptedModuleId -> ArtifactEncryptionService.getInstance() - .addSoftwareModuleEncryptionSecrets(encryptedModuleId)); + .addEncryptionSecrets(encryptedModuleId)); } return createdModules; } @@ -136,7 +136,7 @@ public class JpaSoftwareModuleManagement implements SoftwareModuleManagement { if (create.isEncrypted()) { // flush sm creation in order to get an Id entityManager.flush(); - ArtifactEncryptionService.getInstance().addSoftwareModuleEncryptionSecrets(sm.getId()); + ArtifactEncryptionService.getInstance().addEncryptionSecrets(sm.getId()); } return sm; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSystemManagement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSystemManagement.java index 7965f0eef..56336852d 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSystemManagement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/management/JpaSystemManagement.java @@ -14,7 +14,7 @@ import java.util.function.Consumer; import jakarta.persistence.EntityManager; import lombok.extern.slf4j.Slf4j; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; import org.eclipse.hawkbit.cache.TenancyCacheManager; import org.eclipse.hawkbit.repository.RepositoryProperties; import org.eclipse.hawkbit.repository.RolloutStatusCache; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaArtifact.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaArtifact.java index b1fa9c1af..4fc3bbd36 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaArtifact.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaArtifact.java @@ -28,7 +28,7 @@ import jakarta.validation.constraints.Size; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.AbstractDbArtifact; import org.eclipse.hawkbit.repository.model.Artifact; import org.eclipse.hawkbit.repository.model.SoftwareModule; diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java index 36e666c5a..bfb29e4f6 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/management/ArtifactManagementTest.java @@ -27,8 +27,8 @@ import java.util.concurrent.Callable; import jakarta.validation.ConstraintViolationException; import org.apache.commons.io.IOUtils; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; import org.eclipse.hawkbit.im.authentication.SpPermission; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleCreatedEvent; diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java index 436bf30c6..dc8026b2d 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/TestConfiguration.java @@ -17,11 +17,11 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.atomic.AtomicLong; import org.eclipse.hawkbit.ContextAware; -import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties; -import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemRepository; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; -import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties; -import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler; +import org.eclipse.hawkbit.repository.artifact.ArtifactFilesystemProperties; +import org.eclipse.hawkbit.repository.artifact.ArtifactFilesystemRepository; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.urlhandler.ArtifactUrlHandlerProperties; +import org.eclipse.hawkbit.repository.artifact.urlhandler.PropertyBasedArtifactUrlHandler; import org.eclipse.hawkbit.cache.TenantAwareCacheManager; import org.eclipse.hawkbit.event.BusProtoStuffMessageConverter; import org.eclipse.hawkbit.im.authentication.SpRole; diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/AbstractIntegrationTest.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/AbstractIntegrationTest.java index cbcbe4653..0ea13da37 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/AbstractIntegrationTest.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/AbstractIntegrationTest.java @@ -28,8 +28,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; import org.awaitility.Awaitility; import org.awaitility.core.ConditionFactory; -import org.eclipse.hawkbit.artifact.repository.ArtifactRepository; -import org.eclipse.hawkbit.artifact.repository.ArtifactStoreException; +import org.eclipse.hawkbit.repository.artifact.ArtifactRepository; +import org.eclipse.hawkbit.repository.artifact.exception.ArtifactStoreException; import org.eclipse.hawkbit.repository.ArtifactManagement; import org.eclipse.hawkbit.repository.ConfirmationManagement; import org.eclipse.hawkbit.repository.ControllerManagement; diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java index a408e9442..7f0f796a7 100644 --- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java +++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/util/FileStreamingUtil.java @@ -26,7 +26,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; diff --git a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java index 8437fb82d..d862804ea 100644 --- a/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java +++ b/hawkbit-rest-core/src/test/java/org/eclipse/hawkbit/rest/util/FileStreamingUtilTest.java @@ -25,8 +25,8 @@ import jakarta.servlet.ServletOutputStream; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifact; -import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifact; +import org.eclipse.hawkbit.repository.artifact.model.DbArtifactHash; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito;