-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account names encryption via AWS KMS (#2120)
- Adds accounts.encryption configuration to define both the type (aws, local) and the specifics of both. - Adds EncryptionApiManager, which determines the IEncryptionApi implementation to use. - Adds the LocalEncryptionApiService implementation of IEncryptionApi, that encrypts/decrypts data in local (not suitable for production). - Adds the AwsEncryptionApiService implementation of IEncryptionApi, that encrypts/decrypts data in the cloud using the AWS KMS service. - Adds the related tests. - Adds encryption for Account['name'] in AccountsDatasource.
- Loading branch information
1 parent
28e52ab
commit 20e8be8
Showing
17 changed files
with
962 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; | ||
import { AccountsDatasource } from '@/datasources/accounts/accounts.datasource'; | ||
import { EncryptionApiManager } from '@/datasources/accounts/encryption/encryption-api.manager'; | ||
import { PostgresDatabaseModule } from '@/datasources/db/v1/postgres-database.module'; | ||
import { IAccountsDatasource } from '@/domain/interfaces/accounts.datasource.interface'; | ||
import { IEncryptionApiManager } from '@/domain/interfaces/encryption-api.manager.interface'; | ||
import { Module } from '@nestjs/common'; | ||
|
||
@Module({ | ||
imports: [PostgresDatabaseModule], | ||
providers: [{ provide: IAccountsDatasource, useClass: AccountsDatasource }], | ||
exports: [IAccountsDatasource], | ||
providers: [ | ||
{ provide: IAccountsDatasource, useClass: AccountsDatasource }, | ||
{ provide: IEncryptionApiManager, useClass: EncryptionApiManager }, | ||
], | ||
exports: [IAccountsDatasource, IEncryptionApiManager], | ||
}) | ||
export class AccountsDatasourceModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.