Skip to content
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

Add a database-backed secret resolver (basically identical to the config one, so consider refactoring that) #1887

Closed
alecthomas opened this issue Jun 26, 2024 · 2 comments · Fixed by #1901
Assignees

Comments

@alecthomas
Copy link
Collaborator

Currently we have an ASM resolver + provider in production, which results in all operations hitting ASM, and FTL in production being restricted to a single secret source. By having a database resolver, we can reduce the calls to ASM, and support multiple providers (eg. a local Linux keychain for single-host deploys, inline (needs additional encryption), etc.)

@alecthomas alecthomas added the next Work that will be be picked up next label Jun 26, 2024
@github-actions github-actions bot added triage Issue needs triaging and removed triage Issue needs triaging labels Jun 26, 2024
@ftl-robot ftl-robot mentioned this issue Jun 26, 2024
@safeer safeer self-assigned this Jun 27, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Jun 27, 2024
@safeer
Copy link
Contributor

safeer commented Jun 27, 2024

I've got most of this implemented, but seems like we need to think through the Router (fka Resolver) vs Provider relationship. There can only be one router, but there can be multiple providers. When projectconfig_resolver was the only router, this made sense since you'd read and write to the provider, and update the router (i.e. adding references).

Since then, the Router vs Provider relationship has become conflated, with functionality split between the two. See asm.go which conforms to both, and db_config_provider and db_config_resolver, the latter only implementing List.

With two separate secret providers for production (either ASM or DB) the assumption of keeping a router up to date with all changes to providers doesn't hold anymore.

It seems like things will be a lot cleaner if we either support multiple Routers, or remove the Router notion entirely and keep Resolvers with projectconfig as the only special case.

cc @alecthomas @wesbillman

@alecthomas
Copy link
Collaborator Author

alecthomas commented Jun 27, 2024

There should only ever by a single router. In the ASM case this relationship still held true - there was a single router and a single provider. The router should be removed from ASM now that we have a DB router.

alecthomas added a commit that referenced this issue Jul 1, 2024
The `--compose` flag writes a completely self-contained Docker compose
file that starts PG + ftl-in-a-box.

Also:
- Modified BuildEngine.Graph() to pull dependencies from the schema as
well, because that's all we have in the box.
- Added an integration test.

> [!WARNING]
> Until #1887 is integrated, config/secrets can't be used, and once that
lands `ftl box` will need to switch to an alternate config/secret
resolver.
safeer added a commit that referenced this issue Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants