From 2a4f20d080d31a8aab10a93ca0850e21c07c3860 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 16:48:10 +0100 Subject: [PATCH 1/8] check boxes and add entries in CHANGELOG.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c33a5df..b2ca834 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ TBD ### Functional - [ ] **Provide RESTful API for cryptographic operations**: Expose endpoints for managing cryptographic material and securing data (files, metadata) at rest. -- [ ] **Asymmetric encryption and decryption**: Support RSA and other asymmetric encryption algorithms for data protection. -- [ ] **Symmetric encryption**: Support for symmetric key encryption (e.g. AES) for data protection. -- [ ] **Hashing and signature verification**: Support hashing algorithms (e.g. SHA-256, SHA-512) and verify signatures using asymmetric keys (RSA, ECDSA, etc.). +- [x] **Asymmetric encryption and decryption**: Support RSA and other asymmetric encryption algorithms for data protection. +- [x] **Symmetric encryption**: Support for symmetric key encryption (e.g. AES) for data protection. +- [x] **Hashing and signature verification**: Support hashing algorithms (e.g. SHA-256, SHA-512) and verify signatures using asymmetric keys (RSA, ECDSA, etc.). - [ ] **PKCS#11 integration**: Enable key management in FIPS-compliant hardware or software. - [ ] **Manage cryptographic material**: Enable management of private/public key pairs and symmetric keys (generation, import/export, rotation, etc.). - [ ] **Key management lifecycle**: Implement key lifecycle management (generation, rotation, revocation, expiration). From 7ff5502bc18e7251b58fdba0bbcd50f34d3329b8 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 16:54:11 +0100 Subject: [PATCH 2/8] rename test files --- .../cryptography/{encryption_test.go => aes_test.go} | 0 .../cryptography/{hashing_test.go => ecdsa_test.go} | 0 .../cryptography/io_test.go} | 0 .../cryptography/rsa_test.go} | 0 tests/unit-tests/cryptography/aes_test.go | 0 tests/unit-tests/cryptography/ecdsa_test.go | 0 tests/unit-tests/cryptography/io_test.go | 0 tests/unit-tests/cryptography/rsa_test.go | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename tests/integration-tests/cryptography/{encryption_test.go => aes_test.go} (100%) rename tests/integration-tests/cryptography/{hashing_test.go => ecdsa_test.go} (100%) rename tests/{unit-tests/cryptography/encryption_test.go => integration-tests/cryptography/io_test.go} (100%) rename tests/{unit-tests/cryptography/hashing_test.go => integration-tests/cryptography/rsa_test.go} (100%) create mode 100644 tests/unit-tests/cryptography/aes_test.go create mode 100644 tests/unit-tests/cryptography/ecdsa_test.go create mode 100644 tests/unit-tests/cryptography/io_test.go create mode 100644 tests/unit-tests/cryptography/rsa_test.go diff --git a/tests/integration-tests/cryptography/encryption_test.go b/tests/integration-tests/cryptography/aes_test.go similarity index 100% rename from tests/integration-tests/cryptography/encryption_test.go rename to tests/integration-tests/cryptography/aes_test.go diff --git a/tests/integration-tests/cryptography/hashing_test.go b/tests/integration-tests/cryptography/ecdsa_test.go similarity index 100% rename from tests/integration-tests/cryptography/hashing_test.go rename to tests/integration-tests/cryptography/ecdsa_test.go diff --git a/tests/unit-tests/cryptography/encryption_test.go b/tests/integration-tests/cryptography/io_test.go similarity index 100% rename from tests/unit-tests/cryptography/encryption_test.go rename to tests/integration-tests/cryptography/io_test.go diff --git a/tests/unit-tests/cryptography/hashing_test.go b/tests/integration-tests/cryptography/rsa_test.go similarity index 100% rename from tests/unit-tests/cryptography/hashing_test.go rename to tests/integration-tests/cryptography/rsa_test.go diff --git a/tests/unit-tests/cryptography/aes_test.go b/tests/unit-tests/cryptography/aes_test.go new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit-tests/cryptography/ecdsa_test.go b/tests/unit-tests/cryptography/ecdsa_test.go new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit-tests/cryptography/io_test.go b/tests/unit-tests/cryptography/io_test.go new file mode 100644 index 0000000..e69de29 diff --git a/tests/unit-tests/cryptography/rsa_test.go b/tests/unit-tests/cryptography/rsa_test.go new file mode 100644 index 0000000..e69de29 From fab04ac65d3cf030c2d646faefec10f5773a9f8b Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:16:23 +0100 Subject: [PATCH 3/8] rename folders --- {tests => test}/data/.gitignore | 0 .../integration}/cryptography/aes_test.go | 0 .../integration}/cryptography/ecdsa_test.go | 0 .../integration}/cryptography/io_test.go | 0 .../integration}/cryptography/rsa_test.go | 0 .../integration}/storage/az_blob_test.go | 0 .../integration}/storage/az_postgres_test.go | 0 .../integration}/storage/az_vault_test.go | 0 test/unit/cryptography/aes_test.go | 1 + {tests/unit-tests => test/unit}/cryptography/ecdsa_test.go | 0 {tests/unit-tests => test/unit}/cryptography/io_test.go | 0 {tests/unit-tests => test/unit}/cryptography/rsa_test.go | 0 {tests/unit-tests => test/unit}/storage/az_blob_test.go | 0 {tests/unit-tests => test/unit}/storage/az_postgres_test.go | 0 {tests/unit-tests => test/unit}/storage/az_vault_test.go | 0 tests/unit-tests/cryptography/aes_test.go | 0 16 files changed, 1 insertion(+) rename {tests => test}/data/.gitignore (100%) rename {tests/integration-tests => test/integration}/cryptography/aes_test.go (100%) rename {tests/integration-tests => test/integration}/cryptography/ecdsa_test.go (100%) rename {tests/integration-tests => test/integration}/cryptography/io_test.go (100%) rename {tests/integration-tests => test/integration}/cryptography/rsa_test.go (100%) rename {tests/integration-tests => test/integration}/storage/az_blob_test.go (100%) rename {tests/integration-tests => test/integration}/storage/az_postgres_test.go (100%) rename {tests/integration-tests => test/integration}/storage/az_vault_test.go (100%) create mode 100644 test/unit/cryptography/aes_test.go rename {tests/unit-tests => test/unit}/cryptography/ecdsa_test.go (100%) rename {tests/unit-tests => test/unit}/cryptography/io_test.go (100%) rename {tests/unit-tests => test/unit}/cryptography/rsa_test.go (100%) rename {tests/unit-tests => test/unit}/storage/az_blob_test.go (100%) rename {tests/unit-tests => test/unit}/storage/az_postgres_test.go (100%) rename {tests/unit-tests => test/unit}/storage/az_vault_test.go (100%) delete mode 100644 tests/unit-tests/cryptography/aes_test.go diff --git a/tests/data/.gitignore b/test/data/.gitignore similarity index 100% rename from tests/data/.gitignore rename to test/data/.gitignore diff --git a/tests/integration-tests/cryptography/aes_test.go b/test/integration/cryptography/aes_test.go similarity index 100% rename from tests/integration-tests/cryptography/aes_test.go rename to test/integration/cryptography/aes_test.go diff --git a/tests/integration-tests/cryptography/ecdsa_test.go b/test/integration/cryptography/ecdsa_test.go similarity index 100% rename from tests/integration-tests/cryptography/ecdsa_test.go rename to test/integration/cryptography/ecdsa_test.go diff --git a/tests/integration-tests/cryptography/io_test.go b/test/integration/cryptography/io_test.go similarity index 100% rename from tests/integration-tests/cryptography/io_test.go rename to test/integration/cryptography/io_test.go diff --git a/tests/integration-tests/cryptography/rsa_test.go b/test/integration/cryptography/rsa_test.go similarity index 100% rename from tests/integration-tests/cryptography/rsa_test.go rename to test/integration/cryptography/rsa_test.go diff --git a/tests/integration-tests/storage/az_blob_test.go b/test/integration/storage/az_blob_test.go similarity index 100% rename from tests/integration-tests/storage/az_blob_test.go rename to test/integration/storage/az_blob_test.go diff --git a/tests/integration-tests/storage/az_postgres_test.go b/test/integration/storage/az_postgres_test.go similarity index 100% rename from tests/integration-tests/storage/az_postgres_test.go rename to test/integration/storage/az_postgres_test.go diff --git a/tests/integration-tests/storage/az_vault_test.go b/test/integration/storage/az_vault_test.go similarity index 100% rename from tests/integration-tests/storage/az_vault_test.go rename to test/integration/storage/az_vault_test.go diff --git a/test/unit/cryptography/aes_test.go b/test/unit/cryptography/aes_test.go new file mode 100644 index 0000000..ba9890f --- /dev/null +++ b/test/unit/cryptography/aes_test.go @@ -0,0 +1 @@ +// tbd \ No newline at end of file diff --git a/tests/unit-tests/cryptography/ecdsa_test.go b/test/unit/cryptography/ecdsa_test.go similarity index 100% rename from tests/unit-tests/cryptography/ecdsa_test.go rename to test/unit/cryptography/ecdsa_test.go diff --git a/tests/unit-tests/cryptography/io_test.go b/test/unit/cryptography/io_test.go similarity index 100% rename from tests/unit-tests/cryptography/io_test.go rename to test/unit/cryptography/io_test.go diff --git a/tests/unit-tests/cryptography/rsa_test.go b/test/unit/cryptography/rsa_test.go similarity index 100% rename from tests/unit-tests/cryptography/rsa_test.go rename to test/unit/cryptography/rsa_test.go diff --git a/tests/unit-tests/storage/az_blob_test.go b/test/unit/storage/az_blob_test.go similarity index 100% rename from tests/unit-tests/storage/az_blob_test.go rename to test/unit/storage/az_blob_test.go diff --git a/tests/unit-tests/storage/az_postgres_test.go b/test/unit/storage/az_postgres_test.go similarity index 100% rename from tests/unit-tests/storage/az_postgres_test.go rename to test/unit/storage/az_postgres_test.go diff --git a/tests/unit-tests/storage/az_vault_test.go b/test/unit/storage/az_vault_test.go similarity index 100% rename from tests/unit-tests/storage/az_vault_test.go rename to test/unit/storage/az_vault_test.go diff --git a/tests/unit-tests/cryptography/aes_test.go b/tests/unit-tests/cryptography/aes_test.go deleted file mode 100644 index e69de29..0000000 From 3c82bae6ae8aeb703cfd64d33ff4bad2118427b8 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:23:48 +0100 Subject: [PATCH 4/8] consider DDD --- cmd/crypto-vault-cli/crypto-vault-cli.go | 2 +- cmd/crypto-vault-service/crypto-vault-service.go | 2 +- {api => internal/api}/v1/errors.go | 0 {api => internal/api}/v1/handlers.go | 0 {api => internal/api}/v1/middleware.go | 0 {api => internal/api}/v1/models.go | 0 {api => internal/api}/v1/responses.go | 0 {api => internal/api}/v1/routes.go | 0 {api => internal/api}/v1/utils.go | 0 {api => internal/api}/v1/version.go | 0 internal/app/.gitkeep | 1 + internal/domain/.gitkeep | 1 + {pkg => internal/infrastructure}/cryptography/aes.go | 0 {pkg => internal/infrastructure}/cryptography/ecdsa.go | 0 {pkg => internal/infrastructure}/cryptography/io.go | 0 {pkg => internal/infrastructure}/cryptography/rsa.go | 0 {pkg => internal/infrastructure}/storage/az_blob.go | 0 {pkg => internal/infrastructure}/storage/az_postgres.go | 0 {pkg => internal/infrastructure}/storage/az_vault.go | 0 internal/persistence/.gitkeep | 1 + test/integration/cryptography/aes_test.go | 0 test/integration/domain/.gitkeep | 1 + .../infrastructure}/cryptography/aes_test.go | 0 .../integration/{ => infrastructure}/cryptography/ecdsa_test.go | 0 test/integration/{ => infrastructure}/cryptography/io_test.go | 0 test/integration/{ => infrastructure}/cryptography/rsa_test.go | 0 test/integration/{ => infrastructure}/storage/az_blob_test.go | 0 .../{ => infrastructure}/storage/az_postgres_test.go | 0 test/integration/{ => infrastructure}/storage/az_vault_test.go | 0 test/integration/persistence/.gitkeep | 1 + test/unit/domain/.gitkeep | 1 + test/unit/infrastructure/cryptography/aes_test.go | 1 + test/unit/{ => infrastructure}/cryptography/ecdsa_test.go | 0 test/unit/{ => infrastructure}/cryptography/io_test.go | 0 test/unit/{ => infrastructure}/cryptography/rsa_test.go | 0 test/unit/{ => infrastructure}/storage/az_blob_test.go | 0 test/unit/{ => infrastructure}/storage/az_postgres_test.go | 0 test/unit/{ => infrastructure}/storage/az_vault_test.go | 0 test/unit/persistence/.gitkeep | 1 + 39 files changed, 10 insertions(+), 2 deletions(-) rename {api => internal/api}/v1/errors.go (100%) rename {api => internal/api}/v1/handlers.go (100%) rename {api => internal/api}/v1/middleware.go (100%) rename {api => internal/api}/v1/models.go (100%) rename {api => internal/api}/v1/responses.go (100%) rename {api => internal/api}/v1/routes.go (100%) rename {api => internal/api}/v1/utils.go (100%) rename {api => internal/api}/v1/version.go (100%) create mode 100644 internal/app/.gitkeep create mode 100644 internal/domain/.gitkeep rename {pkg => internal/infrastructure}/cryptography/aes.go (100%) rename {pkg => internal/infrastructure}/cryptography/ecdsa.go (100%) rename {pkg => internal/infrastructure}/cryptography/io.go (100%) rename {pkg => internal/infrastructure}/cryptography/rsa.go (100%) rename {pkg => internal/infrastructure}/storage/az_blob.go (100%) rename {pkg => internal/infrastructure}/storage/az_postgres.go (100%) rename {pkg => internal/infrastructure}/storage/az_vault.go (100%) create mode 100644 internal/persistence/.gitkeep delete mode 100644 test/integration/cryptography/aes_test.go create mode 100644 test/integration/domain/.gitkeep rename test/{unit => integration/infrastructure}/cryptography/aes_test.go (100%) rename test/integration/{ => infrastructure}/cryptography/ecdsa_test.go (100%) rename test/integration/{ => infrastructure}/cryptography/io_test.go (100%) rename test/integration/{ => infrastructure}/cryptography/rsa_test.go (100%) rename test/integration/{ => infrastructure}/storage/az_blob_test.go (100%) rename test/integration/{ => infrastructure}/storage/az_postgres_test.go (100%) rename test/integration/{ => infrastructure}/storage/az_vault_test.go (100%) create mode 100644 test/integration/persistence/.gitkeep create mode 100644 test/unit/domain/.gitkeep create mode 100644 test/unit/infrastructure/cryptography/aes_test.go rename test/unit/{ => infrastructure}/cryptography/ecdsa_test.go (100%) rename test/unit/{ => infrastructure}/cryptography/io_test.go (100%) rename test/unit/{ => infrastructure}/cryptography/rsa_test.go (100%) rename test/unit/{ => infrastructure}/storage/az_blob_test.go (100%) rename test/unit/{ => infrastructure}/storage/az_postgres_test.go (100%) rename test/unit/{ => infrastructure}/storage/az_vault_test.go (100%) create mode 100644 test/unit/persistence/.gitkeep diff --git a/cmd/crypto-vault-cli/crypto-vault-cli.go b/cmd/crypto-vault-cli/crypto-vault-cli.go index 258e421..8589ba4 100644 --- a/cmd/crypto-vault-cli/crypto-vault-cli.go +++ b/cmd/crypto-vault-cli/crypto-vault-cli.go @@ -13,7 +13,7 @@ import ( "github.com/spf13/cobra" - cryptography "crypto_vault_service/pkg/cryptography" + cryptography "crypto_vault_service/internal/infrastructure/cryptography" ) // Encrypts a file using AES and saves the encryption key diff --git a/cmd/crypto-vault-service/crypto-vault-service.go b/cmd/crypto-vault-service/crypto-vault-service.go index 0a00273..7c6f393 100644 --- a/cmd/crypto-vault-service/crypto-vault-service.go +++ b/cmd/crypto-vault-service/crypto-vault-service.go @@ -1,7 +1,7 @@ package main import ( - v1 "crypto_vault_service/api/v1" + v1 "crypto_vault_service/internal/api/v1" "github.com/gin-gonic/gin" ) diff --git a/api/v1/errors.go b/internal/api/v1/errors.go similarity index 100% rename from api/v1/errors.go rename to internal/api/v1/errors.go diff --git a/api/v1/handlers.go b/internal/api/v1/handlers.go similarity index 100% rename from api/v1/handlers.go rename to internal/api/v1/handlers.go diff --git a/api/v1/middleware.go b/internal/api/v1/middleware.go similarity index 100% rename from api/v1/middleware.go rename to internal/api/v1/middleware.go diff --git a/api/v1/models.go b/internal/api/v1/models.go similarity index 100% rename from api/v1/models.go rename to internal/api/v1/models.go diff --git a/api/v1/responses.go b/internal/api/v1/responses.go similarity index 100% rename from api/v1/responses.go rename to internal/api/v1/responses.go diff --git a/api/v1/routes.go b/internal/api/v1/routes.go similarity index 100% rename from api/v1/routes.go rename to internal/api/v1/routes.go diff --git a/api/v1/utils.go b/internal/api/v1/utils.go similarity index 100% rename from api/v1/utils.go rename to internal/api/v1/utils.go diff --git a/api/v1/version.go b/internal/api/v1/version.go similarity index 100% rename from api/v1/version.go rename to internal/api/v1/version.go diff --git a/internal/app/.gitkeep b/internal/app/.gitkeep new file mode 100644 index 0000000..89eb1f3 --- /dev/null +++ b/internal/app/.gitkeep @@ -0,0 +1 @@ +Service impl \ No newline at end of file diff --git a/internal/domain/.gitkeep b/internal/domain/.gitkeep new file mode 100644 index 0000000..760c903 --- /dev/null +++ b/internal/domain/.gitkeep @@ -0,0 +1 @@ +Domain models, service contracts \ No newline at end of file diff --git a/pkg/cryptography/aes.go b/internal/infrastructure/cryptography/aes.go similarity index 100% rename from pkg/cryptography/aes.go rename to internal/infrastructure/cryptography/aes.go diff --git a/pkg/cryptography/ecdsa.go b/internal/infrastructure/cryptography/ecdsa.go similarity index 100% rename from pkg/cryptography/ecdsa.go rename to internal/infrastructure/cryptography/ecdsa.go diff --git a/pkg/cryptography/io.go b/internal/infrastructure/cryptography/io.go similarity index 100% rename from pkg/cryptography/io.go rename to internal/infrastructure/cryptography/io.go diff --git a/pkg/cryptography/rsa.go b/internal/infrastructure/cryptography/rsa.go similarity index 100% rename from pkg/cryptography/rsa.go rename to internal/infrastructure/cryptography/rsa.go diff --git a/pkg/storage/az_blob.go b/internal/infrastructure/storage/az_blob.go similarity index 100% rename from pkg/storage/az_blob.go rename to internal/infrastructure/storage/az_blob.go diff --git a/pkg/storage/az_postgres.go b/internal/infrastructure/storage/az_postgres.go similarity index 100% rename from pkg/storage/az_postgres.go rename to internal/infrastructure/storage/az_postgres.go diff --git a/pkg/storage/az_vault.go b/internal/infrastructure/storage/az_vault.go similarity index 100% rename from pkg/storage/az_vault.go rename to internal/infrastructure/storage/az_vault.go diff --git a/internal/persistence/.gitkeep b/internal/persistence/.gitkeep new file mode 100644 index 0000000..e430dec --- /dev/null +++ b/internal/persistence/.gitkeep @@ -0,0 +1 @@ +SQL, NoSQL queries or commands \ No newline at end of file diff --git a/test/integration/cryptography/aes_test.go b/test/integration/cryptography/aes_test.go deleted file mode 100644 index e69de29..0000000 diff --git a/test/integration/domain/.gitkeep b/test/integration/domain/.gitkeep new file mode 100644 index 0000000..760c903 --- /dev/null +++ b/test/integration/domain/.gitkeep @@ -0,0 +1 @@ +Domain models, service contracts \ No newline at end of file diff --git a/test/unit/cryptography/aes_test.go b/test/integration/infrastructure/cryptography/aes_test.go similarity index 100% rename from test/unit/cryptography/aes_test.go rename to test/integration/infrastructure/cryptography/aes_test.go diff --git a/test/integration/cryptography/ecdsa_test.go b/test/integration/infrastructure/cryptography/ecdsa_test.go similarity index 100% rename from test/integration/cryptography/ecdsa_test.go rename to test/integration/infrastructure/cryptography/ecdsa_test.go diff --git a/test/integration/cryptography/io_test.go b/test/integration/infrastructure/cryptography/io_test.go similarity index 100% rename from test/integration/cryptography/io_test.go rename to test/integration/infrastructure/cryptography/io_test.go diff --git a/test/integration/cryptography/rsa_test.go b/test/integration/infrastructure/cryptography/rsa_test.go similarity index 100% rename from test/integration/cryptography/rsa_test.go rename to test/integration/infrastructure/cryptography/rsa_test.go diff --git a/test/integration/storage/az_blob_test.go b/test/integration/infrastructure/storage/az_blob_test.go similarity index 100% rename from test/integration/storage/az_blob_test.go rename to test/integration/infrastructure/storage/az_blob_test.go diff --git a/test/integration/storage/az_postgres_test.go b/test/integration/infrastructure/storage/az_postgres_test.go similarity index 100% rename from test/integration/storage/az_postgres_test.go rename to test/integration/infrastructure/storage/az_postgres_test.go diff --git a/test/integration/storage/az_vault_test.go b/test/integration/infrastructure/storage/az_vault_test.go similarity index 100% rename from test/integration/storage/az_vault_test.go rename to test/integration/infrastructure/storage/az_vault_test.go diff --git a/test/integration/persistence/.gitkeep b/test/integration/persistence/.gitkeep new file mode 100644 index 0000000..760c903 --- /dev/null +++ b/test/integration/persistence/.gitkeep @@ -0,0 +1 @@ +Domain models, service contracts \ No newline at end of file diff --git a/test/unit/domain/.gitkeep b/test/unit/domain/.gitkeep new file mode 100644 index 0000000..760c903 --- /dev/null +++ b/test/unit/domain/.gitkeep @@ -0,0 +1 @@ +Domain models, service contracts \ No newline at end of file diff --git a/test/unit/infrastructure/cryptography/aes_test.go b/test/unit/infrastructure/cryptography/aes_test.go new file mode 100644 index 0000000..ba9890f --- /dev/null +++ b/test/unit/infrastructure/cryptography/aes_test.go @@ -0,0 +1 @@ +// tbd \ No newline at end of file diff --git a/test/unit/cryptography/ecdsa_test.go b/test/unit/infrastructure/cryptography/ecdsa_test.go similarity index 100% rename from test/unit/cryptography/ecdsa_test.go rename to test/unit/infrastructure/cryptography/ecdsa_test.go diff --git a/test/unit/cryptography/io_test.go b/test/unit/infrastructure/cryptography/io_test.go similarity index 100% rename from test/unit/cryptography/io_test.go rename to test/unit/infrastructure/cryptography/io_test.go diff --git a/test/unit/cryptography/rsa_test.go b/test/unit/infrastructure/cryptography/rsa_test.go similarity index 100% rename from test/unit/cryptography/rsa_test.go rename to test/unit/infrastructure/cryptography/rsa_test.go diff --git a/test/unit/storage/az_blob_test.go b/test/unit/infrastructure/storage/az_blob_test.go similarity index 100% rename from test/unit/storage/az_blob_test.go rename to test/unit/infrastructure/storage/az_blob_test.go diff --git a/test/unit/storage/az_postgres_test.go b/test/unit/infrastructure/storage/az_postgres_test.go similarity index 100% rename from test/unit/storage/az_postgres_test.go rename to test/unit/infrastructure/storage/az_postgres_test.go diff --git a/test/unit/storage/az_vault_test.go b/test/unit/infrastructure/storage/az_vault_test.go similarity index 100% rename from test/unit/storage/az_vault_test.go rename to test/unit/infrastructure/storage/az_vault_test.go diff --git a/test/unit/persistence/.gitkeep b/test/unit/persistence/.gitkeep new file mode 100644 index 0000000..760c903 --- /dev/null +++ b/test/unit/persistence/.gitkeep @@ -0,0 +1 @@ +Domain models, service contracts \ No newline at end of file From ca1935fc2008f412450f68a8dd44b46d5c0fbd39 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:34:26 +0100 Subject: [PATCH 5/8] add ADR considering DDD --- docs/architecture-decision-record/ddd.md | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 docs/architecture-decision-record/ddd.md diff --git a/docs/architecture-decision-record/ddd.md b/docs/architecture-decision-record/ddd.md new file mode 100644 index 0000000..ce501dc --- /dev/null +++ b/docs/architecture-decision-record/ddd.md @@ -0,0 +1,49 @@ +# Domain-driven Design + +Incorporating DDD as an architecture decision impacts the structure and development process of the entire application. By aligning the software architecture with the business domain, we promote a more **modular, flexible and maintainable** design. The goal is to deeply understand the domain, represent it through domain models and ensure that the application closely matches the business processes. + +```sh +. +├── cmd +│ ├── crypto-vault-cli +│ │ ├── README.md +│ │ ├── crypto-vault-cli.go +│ │ └── data +│ │ ├── decrypted.txt +│ │ ├── decryptedII.txt +│ │ ├── encryptedII.txt +│ │ ├── encryption_key.bin +│ │ ├── input.txt +│ │ ├── output.enc +│ │ ├── private_key.pem +│ │ ├── public_key.pem +│ │ └── signature.sig +│ └── crypto-vault-service +│ ├── Dockerfile +│ └── crypto-vault-service.go +├── configs +│ ├── dev.yml +│ ├── prd.yml +│ └── qas.yml +├── go.mod +├── go.sum +├── internal +│ ├── api +│ │ └── v1 +│ │ └── v2 +│ │ └── ... +│ ├── app +│ ├── domain +│ ├── infrastructure +│ └── persistence +└── test + ├── data + ├── integration + │ ├── domain + │ ├── infrastructure + │ └── persistence + └── unit + ├── domain + ├── infrastructure + └── persistence +``` \ No newline at end of file From e9a80aa736504cfc3ebb83d9a4b61760ec1eff7d Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:34:39 +0100 Subject: [PATCH 6/8] rename folder --- internal/infrastructure/{storage => connector}/az_blob.go | 0 internal/infrastructure/{storage => connector}/az_postgres.go | 0 internal/infrastructure/{storage => connector}/az_vault.go | 0 .../infrastructure/{storage => connector}/az_blob_test.go | 0 .../infrastructure/{storage => connector}/az_postgres_test.go | 0 .../infrastructure/{storage => connector}/az_vault_test.go | 0 test/unit/infrastructure/{storage => connector}/az_blob_test.go | 0 .../infrastructure/{storage => connector}/az_postgres_test.go | 0 test/unit/infrastructure/{storage => connector}/az_vault_test.go | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename internal/infrastructure/{storage => connector}/az_blob.go (100%) rename internal/infrastructure/{storage => connector}/az_postgres.go (100%) rename internal/infrastructure/{storage => connector}/az_vault.go (100%) rename test/integration/infrastructure/{storage => connector}/az_blob_test.go (100%) rename test/integration/infrastructure/{storage => connector}/az_postgres_test.go (100%) rename test/integration/infrastructure/{storage => connector}/az_vault_test.go (100%) rename test/unit/infrastructure/{storage => connector}/az_blob_test.go (100%) rename test/unit/infrastructure/{storage => connector}/az_postgres_test.go (100%) rename test/unit/infrastructure/{storage => connector}/az_vault_test.go (100%) diff --git a/internal/infrastructure/storage/az_blob.go b/internal/infrastructure/connector/az_blob.go similarity index 100% rename from internal/infrastructure/storage/az_blob.go rename to internal/infrastructure/connector/az_blob.go diff --git a/internal/infrastructure/storage/az_postgres.go b/internal/infrastructure/connector/az_postgres.go similarity index 100% rename from internal/infrastructure/storage/az_postgres.go rename to internal/infrastructure/connector/az_postgres.go diff --git a/internal/infrastructure/storage/az_vault.go b/internal/infrastructure/connector/az_vault.go similarity index 100% rename from internal/infrastructure/storage/az_vault.go rename to internal/infrastructure/connector/az_vault.go diff --git a/test/integration/infrastructure/storage/az_blob_test.go b/test/integration/infrastructure/connector/az_blob_test.go similarity index 100% rename from test/integration/infrastructure/storage/az_blob_test.go rename to test/integration/infrastructure/connector/az_blob_test.go diff --git a/test/integration/infrastructure/storage/az_postgres_test.go b/test/integration/infrastructure/connector/az_postgres_test.go similarity index 100% rename from test/integration/infrastructure/storage/az_postgres_test.go rename to test/integration/infrastructure/connector/az_postgres_test.go diff --git a/test/integration/infrastructure/storage/az_vault_test.go b/test/integration/infrastructure/connector/az_vault_test.go similarity index 100% rename from test/integration/infrastructure/storage/az_vault_test.go rename to test/integration/infrastructure/connector/az_vault_test.go diff --git a/test/unit/infrastructure/storage/az_blob_test.go b/test/unit/infrastructure/connector/az_blob_test.go similarity index 100% rename from test/unit/infrastructure/storage/az_blob_test.go rename to test/unit/infrastructure/connector/az_blob_test.go diff --git a/test/unit/infrastructure/storage/az_postgres_test.go b/test/unit/infrastructure/connector/az_postgres_test.go similarity index 100% rename from test/unit/infrastructure/storage/az_postgres_test.go rename to test/unit/infrastructure/connector/az_postgres_test.go diff --git a/test/unit/infrastructure/storage/az_vault_test.go b/test/unit/infrastructure/connector/az_vault_test.go similarity index 100% rename from test/unit/infrastructure/storage/az_vault_test.go rename to test/unit/infrastructure/connector/az_vault_test.go From 248a9876b7a0a58977ef728c0fc6745579cb43ab Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:37:08 +0100 Subject: [PATCH 7/8] modify markdown --- docs/architecture-decision-record/ddd.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/docs/architecture-decision-record/ddd.md b/docs/architecture-decision-record/ddd.md index ce501dc..0440890 100644 --- a/docs/architecture-decision-record/ddd.md +++ b/docs/architecture-decision-record/ddd.md @@ -6,18 +6,8 @@ Incorporating DDD as an architecture decision impacts the structure and developm . ├── cmd │ ├── crypto-vault-cli -│ │ ├── README.md -│ │ ├── crypto-vault-cli.go -│ │ └── data -│ │ ├── decrypted.txt -│ │ ├── decryptedII.txt -│ │ ├── encryptedII.txt -│ │ ├── encryption_key.bin -│ │ ├── input.txt -│ │ ├── output.enc -│ │ ├── private_key.pem -│ │ ├── public_key.pem -│ │ └── signature.sig +│ ├── Dockerfile +│ ├── crypto-vault-cli.go │ └── crypto-vault-service │ ├── Dockerfile │ └── crypto-vault-service.go From a306a78e432374d36315b2af5c2c274cfda5bd47 Mon Sep 17 00:00:00 2001 From: Marvin Gajek Date: Tue, 12 Nov 2024 17:40:40 +0100 Subject: [PATCH 8/8] add CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3209f8..2fd3f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Asymmetric encryption and decryption**: Supported RSA and other asymmetric encryption algorithms for data protection. - **Symmetric encryption**: Supported symmetric key encryption (e.g. AES) for data protection. - **Hashing and signature verification**: Supported hashing algorithms (e.g. SHA-256, SHA-512) and verified signatures using asymmetric keys (RSA, ECDSA, etc.). +- Adopted Domain-Driven Design to create a **modular, flexible and maintainable** project structure with a focus on the **domain at its core** ## [0.1.0] - TBD-TBD-TBD