-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/nar 1545 app setup keygen #139
Conversation
apps/policy-engine/src/keyring/persistence/repository/keyring.repository.ts
Outdated
Show resolved
Hide resolved
apps/policy-engine/src/keyring/persistence/repository/keyring.repository.ts
Outdated
Show resolved
Hide resolved
apps/policy-engine/src/keyring/persistence/repository/keyring.repository.ts
Outdated
Show resolved
Hide resolved
12d6773
to
51bd555
Compare
@wcalderipe Pushed some updated
Other things to note / give feedback on
LMK any thoughts you have, I believe this can be merged & is stable; it may continue to evolve a bit, but the core functions are working now & have basic tests. Do you see places you'd suggest additional tests? |
apps/policy-engine/jest.setup.ts
Outdated
for (const prop in process.env) { | ||
if (Object.prototype.hasOwnProperty.call(process.env, prop)) { | ||
delete process.env[prop] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why not delete process.env
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you want/should delete the whole process.env
object, not sure what happens there...tbh I just copy/pasted a snippet
Cool. I've been thinking about the pattern of using the The provision would involve other services like encryption:
It doesn't have to be done in your PR; it's just an idea I'm exploring. What do you think?
I believe we're good to merge. However, since KMS is critical to the application's logic and security model, I would definitely include an integration test for it. Moreover, I think we should be able to run the application connected to any dependency to easily debug it. I've used LocalStack in the past to simulate AWS services (S3, DynamoDB, Kinesis, and Lambda). They offer a version of KMS, which you can find at LocalStack KMS documentation. Aside from a standalone application, they also distribute it as a Docker image, available at LocalStack Docker images that you can simply drop in the
Copy that. Do you think you can set up the Armory project to do the same? I'd prefer that we have a consistent way of handling cross-functional tasks like environment management. |
describe('EncryptionService', () => { | ||
let service: EncryptionService | ||
|
||
nock.enableNetConnect('kms.us-east-2.amazonaws.com:443') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left you a comment about using localstack #139 (comment) instead of connecting to AWS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: testing KMS --
let me push that to "I'll add integration test on this separately, solving that problem on it's own"
I believe for KMS I probably prefer the solution of just actually using KMS directly, not localstack, since it's probably easier to have a single real key we're using. I just need to set up reasonable policies & credentials to do it, but we'd have to run A LOT of ci/cd to make it a cost-issue so I actually don't think there's a concern using KMS directly from local or ci/cd.
I definitely agree with your point that any dependency should be easy to set up / debug against. This has been a severe bottleneck in the past.
1f47778
to
3e4d6ab
Compare
…ygen Feature/nar 1545 app setup keygen
No description provided.