Skip to content

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Sep 25, 2023

Adds support to dynamically select a backend provider in the CAS proxy

image

  • [CAS] Loads a list of backend providers at boot
  • [CAS] Selects the CAS backend dynamically in each request
  • [Controlplane] Generate a CAS token containing also the backend type, which can be used for the selection above.

This is a prerequisite of #357, once merged we will be able to implement a new backend in CAS + enable it in the controlplane

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri changed the title feat(CAS proxy): multiple CAS backend providers support refactor(CAS proxy): multiple CAS backend providers support Sep 26, 2023
@migmartri migmartri marked this pull request as ready for review September 26, 2023 09:48
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
issues:
exclude-rules:
- path: _test\.go
text: "Potential hardcoded credentials"
Copy link
Member Author

Choose a reason for hiding this comment

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

for some reason now it complains about some of the sha256 digests that we are using during testing

message InfozResponse {
string version = 1;
string version = 1;
repeated string backends = 2;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is in fact the new part. It exposes the enabled backends.

backend.Providers
}

func loadCASBackendProviders(creader credentials.Reader) backend.Providers {
Copy link
Member Author

Choose a reason for hiding this comment

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

the new dynamic loader

@migmartri migmartri requested a review from danlishka September 26, 2023 11:05
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.

LGTM based on the review via conf call

@migmartri migmartri merged commit 0f0f818 into chainloop-dev:main Sep 26, 2023
@migmartri migmartri deleted the load-backends branch September 26, 2023 11:19
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.

2 participants