Skip to content

Commit

Permalink
Moved library to 'engineering.everest.axon' namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sluehr committed Mar 12, 2021
1 parent 59c478f commit 49397bf
Show file tree
Hide file tree
Showing 34 changed files with 85 additions and 84 deletions.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'axon-crypto-shredding-extension'
rootProject.name = 'crypto-shredding-extension'
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package engineering.everest.starterkit.axon.cryptoshredding;
package engineering.everest.axon.cryptoshredding;

import engineering.everest.starterkit.axon.cryptoshredding.encryption.KeyGenerator;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingEncryptionKeyRecordException;
import engineering.everest.starterkit.axon.cryptoshredding.persistence.PersistableSecretKey;
import engineering.everest.starterkit.axon.cryptoshredding.persistence.SecretKeyRepository;
import engineering.everest.axon.cryptoshredding.encryption.KeyGenerator;
import engineering.everest.axon.cryptoshredding.exceptions.MissingEncryptionKeyRecordException;
import engineering.everest.axon.cryptoshredding.persistence.PersistableSecretKey;
import engineering.everest.axon.cryptoshredding.persistence.SecretKeyRepository;
import org.springframework.stereotype.Component;

import javax.crypto.SecretKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package engineering.everest.starterkit.axon.cryptoshredding;
package engineering.everest.axon.cryptoshredding;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import engineering.everest.starterkit.axon.cryptoshredding.encryption.EncrypterDecrypterFactory;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.EncryptionKeyDeletedException;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingSerializedEncryptionKeyIdentifierFieldException;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.UnsupportedEncryptionKeyIdentifierTypeException;
import engineering.everest.axon.cryptoshredding.encryption.EncrypterDecrypterFactory;
import engineering.everest.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import engineering.everest.axon.cryptoshredding.exceptions.EncryptionKeyDeletedException;
import engineering.everest.axon.cryptoshredding.exceptions.MissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.axon.cryptoshredding.exceptions.MissingSerializedEncryptionKeyIdentifierFieldException;
import engineering.everest.axon.cryptoshredding.exceptions.UnsupportedEncryptionKeyIdentifierTypeException;
import lombok.extern.log4j.Log4j2;
import org.axonframework.common.ObjectUtils;
import org.axonframework.serialization.Converter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package engineering.everest.starterkit.axon.cryptoshredding;
package engineering.everest.axon.cryptoshredding;

import engineering.everest.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand All @@ -11,7 +12,7 @@
* Secret key identifier that includes a {@code keyType} parameter. This is used to differentiate between identifiers
* when key uniqueness cannot be globally guaranteed (such as when using monotonically increasing integers).
*
* @see engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptionKeyIdentifier
* @see EncryptionKeyIdentifier
*/
@Embeddable
@Data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.annotations;
package engineering.everest.axon.cryptoshredding.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.annotations;
package engineering.everest.axon.cryptoshredding.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.SecretKey;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import java.security.SecureRandom;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

class DefaultAesKeyGenerator implements engineering.everest.starterkit.axon.cryptoshredding.encryption.KeyGenerator {
class DefaultAesKeyGenerator implements engineering.everest.axon.cryptoshredding.encryption.KeyGenerator {
public static final String ALGORITHM = "AES";
private static final int KEY_SIZE = 256;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.SecretKey;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

public interface EncrypterDecrypterFactory {
Encrypter createEncrypter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
Expand All @@ -16,7 +16,7 @@ public EncrypterDecrypterFactory encrypterDecrypterFactory() {
}

@Bean
@ConditionalOnMissingBean(engineering.everest.starterkit.axon.cryptoshredding.encryption.KeyGenerator.class)
@ConditionalOnMissingBean(KeyGenerator.class)
public KeyGenerator keyGenerator() throws NoSuchAlgorithmException {
return new DefaultAesKeyGenerator();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import javax.crypto.SecretKey;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.exceptions;
package engineering.everest.axon.cryptoshredding.exceptions;

public class EncryptionKeyDeletedException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.exceptions;
package engineering.everest.axon.cryptoshredding.exceptions;

public class MissingEncryptionKeyIdentifierAnnotation extends RuntimeException {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.exceptions;
package engineering.everest.axon.cryptoshredding.exceptions;

public class MissingEncryptionKeyRecordException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.exceptions;
package engineering.everest.axon.cryptoshredding.exceptions;

public class MissingSerializedEncryptionKeyIdentifierFieldException extends RuntimeException {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.exceptions;
package engineering.everest.axon.cryptoshredding.exceptions;

public class UnsupportedEncryptionKeyIdentifierTypeException extends RuntimeException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package engineering.everest.starterkit.axon.cryptoshredding.persistence;
package engineering.everest.axon.cryptoshredding.persistence;

import engineering.everest.starterkit.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import engineering.everest.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package engineering.everest.starterkit.axon.cryptoshredding.persistence;
package engineering.everest.axon.cryptoshredding.persistence;

import engineering.everest.starterkit.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import engineering.everest.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package engineering.everest.starterkit.axon.cryptoshredding;
package engineering.everest.axon.cryptoshredding;

import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingEncryptionKeyRecordException;
import engineering.everest.starterkit.axon.cryptoshredding.persistence.SecretKeyRepository;
import engineering.everest.axon.cryptoshredding.exceptions.MissingEncryptionKeyRecordException;
import engineering.everest.axon.cryptoshredding.persistence.SecretKeyRepository;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -20,9 +20,9 @@

@ExtendWith(SpringExtension.class)
@DataJpaTest
@ComponentScan(basePackages = "engineering.everest.starterkit.axon.cryptoshredding")
@EntityScan(basePackages = "engineering.everest.starterkit.axon.cryptoshredding.persistence")
@EnableJpaRepositories(basePackages = "engineering.everest.starterkit.axon.cryptoshredding.persistence")
@ComponentScan(basePackages = "engineering.everest.axon.cryptoshredding")
@EntityScan(basePackages = "engineering.everest.axon.cryptoshredding.persistence")
@EnableJpaRepositories(basePackages = "engineering.everest.axon.cryptoshredding.persistence")
@ContextConfiguration(classes = TestsJpaConfig.class)
class CryptoShreddingKeyServiceIntegrationTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding;
package engineering.everest.axon.cryptoshredding;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.axonframework.serialization.Serializer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import com.fasterxml.jackson.databind.ObjectMapper;
import engineering.everest.starterkit.axon.cryptoshredding.CryptoShreddingKeyService;
import engineering.everest.starterkit.axon.cryptoshredding.CryptoShreddingSerializer;
import engineering.everest.starterkit.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.EncryptionKeyDeletedException;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.MissingSerializedEncryptionKeyIdentifierFieldException;
import engineering.everest.starterkit.axon.cryptoshredding.exceptions.UnsupportedEncryptionKeyIdentifierTypeException;
import engineering.everest.starterkit.axon.cryptoshredding.persistence.SecretKeyRepository;
import engineering.everest.starterkit.axon.cryptoshredding.testevents.EventWithDifferentiatedKeyType;
import engineering.everest.starterkit.axon.cryptoshredding.testevents.EventWithEncryptedFields;
import engineering.everest.starterkit.axon.cryptoshredding.testevents.EventWithMissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.starterkit.axon.cryptoshredding.testevents.EventWithUnsupportedEncryptionKeyIdentifierType;
import engineering.everest.starterkit.axon.cryptoshredding.testevents.EventWithoutEncryptedFields;
import engineering.everest.axon.cryptoshredding.CryptoShreddingKeyService;
import engineering.everest.axon.cryptoshredding.CryptoShreddingSerializer;
import engineering.everest.axon.cryptoshredding.testevents.EventWithDifferentiatedKeyType;
import engineering.everest.axon.cryptoshredding.testevents.EventWithEncryptedFields;
import engineering.everest.axon.cryptoshredding.testevents.EventWithMissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.axon.cryptoshredding.testevents.EventWithUnsupportedEncryptionKeyIdentifierType;
import engineering.everest.axon.cryptoshredding.testevents.EventWithoutEncryptedFields;
import engineering.everest.axon.cryptoshredding.TypeDifferentiatedSecretKeyId;
import engineering.everest.axon.cryptoshredding.exceptions.EncryptionKeyDeletedException;
import engineering.everest.axon.cryptoshredding.exceptions.MissingEncryptionKeyIdentifierAnnotation;
import engineering.everest.axon.cryptoshredding.exceptions.MissingSerializedEncryptionKeyIdentifierFieldException;
import engineering.everest.axon.cryptoshredding.exceptions.UnsupportedEncryptionKeyIdentifierTypeException;
import engineering.everest.axon.cryptoshredding.persistence.SecretKeyRepository;
import org.axonframework.serialization.Converter;
import org.axonframework.serialization.Serializer;
import org.axonframework.serialization.SimpleSerializedObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.encryption;
package engineering.everest.axon.cryptoshredding.encryption;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package engineering.everest.starterkit.axon.cryptoshredding.testevents;
package engineering.everest.axon.cryptoshredding.testevents;

import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import engineering.everest.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package engineering.everest.starterkit.axon.cryptoshredding.testevents;
package engineering.everest.axon.cryptoshredding.testevents;

import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import engineering.everest.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package engineering.everest.starterkit.axon.cryptoshredding.testevents;
package engineering.everest.axon.cryptoshredding.testevents;

import engineering.everest.starterkit.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.axon.cryptoshredding.annotations.EncryptedField;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package engineering.everest.axon.cryptoshredding.testevents;

import engineering.everest.axon.cryptoshredding.annotations.EncryptedField;
import engineering.everest.axon.cryptoshredding.annotations.EncryptionKeyIdentifier;
import lombok.Data;

@Data
public class EventWithUnsupportedEncryptionKeyIdentifierType {
@EncryptionKeyIdentifier
private float keyIdentifier = 42.0f;
@EncryptedField
private String dummy = "dummy";
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.testevents;
package engineering.everest.axon.cryptoshredding.testevents;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package engineering.everest.starterkit.axon.cryptoshredding.testevents;
package engineering.everest.axon.cryptoshredding.testevents;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down

This file was deleted.

0 comments on commit 49397bf

Please sign in to comment.