-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Request
Look into how to allow multiple providers to be supported for a single gateway app.
Context
For the MVI, we will be completely centralized and running one instance (each) of some gateway services, and will need to support more than one provider per instance.
Outline or additional Details
Preferences:
- Provider keys survive restart (must have)
- Keys can't be exfiltrated (must have)
- Easier maintenance is better
- Easier implementation is better
- Adding new keys without restarting would be nice
- Nice to have: Provider can self-provision - with limitations that should be outlined, e.g. nobody should be able to add signing keys if they aren't already a Provider, and we should always verify that they are, using the submitted public key.
Some off-the-cuff possibilities, which may or may not be reasonable:
-
Maybe there is already a library for this, a plugin for NestJS and we don't have to write one
-
Provider registers webhooks for signing payloads or transactions
- Advantages: maybe a little more security since Gateway doesn't get access to keys, registered webhooks can be safely stored and reloaded after restarts, Provider can self-provision
- Disadvantages: anything that needs signing takes longer, MITM attacks, increased traffic, Provider has to keep endpoint live all the time
-
Support multiple Providers in environment file
- Advantages: maybe the easiest solution in that it's already in use,
- Disadvantages: every time a new Provider is added to environment file, you have to restart the service, Provider cannot self-provision
-
Provider submits their secret keys through an API call, and they are somehow stored securely somewhere in the instance. Maybe stored encrypted in Redis using unique server encryption key that lives in the environment file.
- Advantages: survives restarts, Provider can self-provision, can add new keys without restarting
- Disadvantages: ....add yours
-
Maybe you thought of something even better
[PM/Eng]: Acceptance criteria
- Come up with at least 3 reasonable possibilities
- For each, summarize what it would take to implement
- Write up advantages / disadvantages of each
- Present with recommendation and reasoning