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

Decouple metadata / target retrieval from HTTP #670

Open
random2442 opened this issue Jan 21, 2025 · 0 comments
Open

Decouple metadata / target retrieval from HTTP #670

random2442 opened this issue Jan 21, 2025 · 0 comments

Comments

@random2442
Copy link

random2442 commented Jan 21, 2025

At present you make the assumption that metadata and target retrieval will always be over HTTP. Which is a reasonable assumption given the original indented application where the client devices are not under the control of the updater service.

However, for controlled environments, it could be useful, for example, to use pure S3 to retrieve metadata and target data from an S3 bucket via the S3 API and so they can:
(a) maintain stricter control over privacy and security and
(b) remove the un-necessary need to maintain an HTTP server.

To be clear, I am not saying you should implement the S3 calls itself.

But rather I'm saying you should decouple it so that people can plugin a function of their choice that implements the interface. Just like they can do with the signing mechanism.

Edit to add:

Looking at this a little more, the TL;DR appears to be:

You already made an effort to decouple, but then you forgot all about it when coding updater.

Positives:

✅ You have Fetcher which allows an interface (metadata/fetcher/fetcher.go)
✅ You have Config which allows specification of Fetcher implementation (metadata/config/config.go)

Negatives:

updater.go is (sadly) a bit of a mess that makes many hardcoded assumptions that the Fetcher will always be the default fetcher, i.e.:

  • No way to pass in a Fetcher
  • Large number of http assumptions everywhere (url generation, http error codes etc. etc. etc.)

(Heads-up to #660 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant