estuary / flow

🌊 Continuously synchronize the systems where your data lives, to the systems where you _want_ it to live, with Estuary Flow. 🌊
https://estuary.dev
Other
530 stars 45 forks source link

agent: backend support for updating storage mappings #1438

Closed psFried closed 2 months ago

psFried commented 2 months ago

Description:

Introduces two different pieces of backend functionality in support of a UI for updating storage mappings. The first is a directive for updating the actual storage mappings, including validating the new mapping by ensuring we have appropriate permissions to the bucket. The second is a postgres function that creates a publication of all the existing specs under a given prefix.

Only top-level tenant prefixes are supported at this time. It shouldn't be too hard to support adding new prefixes in the future, but it seemed wise to avoid the complexity for now.

The directive is meant to validate our access to the users storage buckets. It only supports GCS and S3 at this time, but it shouldn't be too hard to add support for azure and even custom storage endpoints. The checks are done by putting a file, listing it, and deleting it. This is somewhat more crude than checking our users permissions, but it works for any cloud provider and ensures that we're only requiring a minimal set of permissions.

The republish_prefix function is needed in order to apply the newly updated storage mappings. Stitching this together with the directive is being left as a UI responsibility for now.

Workflow steps:

The basic steps are (assume --profile local if running locally):

I ran through these steps and tested a few different buckets and scenarios:

Some sad-path scenarios:

Documentation links affected:

None yet, will document once we have UI done.

Notes for reviewers: n/a


This change is Reviewable