Skip to content

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Sep 4, 2023

Enables download endpoints to find the CAS backend that contains a given digest. This solves the limitation we had of downloading from currentOrgs and default backends only. Now an user will be able to download an item from any cas-backend in any of their orgs.

The selection process works as follows:

  • Find the casBackends where we have a record that the digest was uploaded, this is across all the organizations
  • Then match these results with the organizations our user has access to (memberships)
  • if we still have a match, means that we can download the item from one or more cas-backends
  • If we have a single cas-backend or a default one we return that
  • Otherwise the first one

image

This download selection works for both the new /download/sha256:[] endpoint and for the artifact download CLI command.

Closes #268

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri marked this pull request as draft September 4, 2023 18:15
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri requested a review from danlishka September 4, 2023 19:33
@migmartri migmartri marked this pull request as ready for review September 4, 2023 19:33
@migmartri migmartri changed the title feat: during download, pick the right CAS backend feat: dynamic CAS backend selection during download Sep 4, 2023
@migmartri migmartri changed the title feat: dynamic CAS backend selection during download feat(controlplane): dynamic CAS backend selection during download Sep 4, 2023
Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@migmartri migmartri merged commit a427fcc into chainloop-dev:main Sep 5, 2023
@migmartri migmartri deleted the download-from-anywhere branch September 5, 2023 10:31
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 this pull request may close these issues.

Being able to download an artifact even if default CAS backend changed
2 participants