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

Implement Packing/Unpacking of assets? #10

Open
tomcoldrick-ct opened this issue Sep 7, 2020 · 0 comments
Open

Implement Packing/Unpacking of assets? #10

tomcoldrick-ct opened this issue Sep 7, 2020 · 0 comments

Comments

@tomcoldrick-ct
Copy link
Collaborator

The RAAPI spec says that servers may unpack or pack assets based on request, that is the server may unpack a tarball fetched using FetchDirectory and vice versa. Perhaps we should implement this, although it may be more prudent to wait for clients to expect it.

I foresee many details causing headaches with this functionality:

How will this interact with Qualifiers?

Qualifiers are already difficult to wrap the head around, and this will complicate things even further. For example, one can imagine a client FetchBlob request on a directory containing a checksum.sri qualifier, intended to check that the packed directory matches a given checksum - this may be a cheap way to ensure a directory is exactly what was expected - and so this qualifier would be handled after the transformation. On the other hand, for the same reasons, calling FetchDirectory on a blob with this qualifier set, I'd expect the opposite - the qualifier to be applied beforehand.

This is just a single example, and I'm sure there will be an endless rabbit hole filled with more subtleties

Are we expected to populate both directory and blob?

It may be nicer to only fetch the source once and do this packing/unpacking at a single Fetch. However, in doing this we meet an issue that certain qualifiers may only be applied to blobs or directories exclusively. Also, it seems inefficient to do this even if clients don't expect it.

We will need to record whether the asset is a Directory or a Blob

In order to return the correct response we will need to make sure the cached value matches the request, otherwise we may be sending a blob rather than a directory which the client expects.


Implementing this alongside #3 may also be more difficult. I don't think this is urgent until a client expects this behaviour really.

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

No branches or pull requests

1 participant