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

feat(controlplane) generate mapping for items in CAS #327

Merged
merged 8 commits into from
Sep 4, 2023

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Sep 4, 2023

NOTE: Help for reviewers. Most of this code is generated, what you should take a look at are the changes in internal/data/casmapping.go, internal/biz, and service/attestation

This patch enables a mapping in the DB between the digest of the pieces of evidences (materials) and attestations, as well as the CAS backend and WorkflowRun

Once the attestation is received in the controlplane, entries in this table for all the materials uploaded in the CAS + the attestation will be stored.

Example

controlplane=# select digest,cas_mapping_workflow_run,cas_mapping_cas_backend from cas_mappings;
                                 digest                                  |       cas_mapping_workflow_run       |       cas_mapping_cas_backend        
-------------------------------------------------------------------------+--------------------------------------+--------------------------------------
 sha256:330ecf0c226ac03baa9094d70e1c2518e20964afe69c2bb30796e21b286d51d7 | a1cccd29-d3b9-4948-9bad-1d00558ca750 | 3f10073c-67cf-4b58-b4c8-3828a05ef1db
 sha256:9f4fd53ef8d7283400d986fd8643b00310a2ae14c164cba795a589143ac31660 | f37ee7ec-9f12-487c-a2f3-06a0b0812183 | 3f10073c-67cf-4b58-b4c8-3828a05ef1db
 sha256:03053df3aa032e40acba3a9dc6ea24f2fc696e52c03cb83e284cd8839b745899 | 415be765-16e1-4802-9a7b-98dc8798dfbd | 3f10073c-67cf-4b58-b4c8-3828a05ef1db
 sha256:ebe2e6ffab93f4b2e2743d3557bd094427ea059adc78cfe2cd330a72f61731e8 | 415be765-16e1-4802-9a7b-98dc8798dfbd | 3f10073c-67cf-4b58-b4c8-3828a05ef1db

The next step in another patch will be to leverage this mapping during download, re: #268

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>
@@ -419,7 +419,7 @@ func (uc *CASBackendUseCase) PerformValidation(ctx context.Context, id string) (

if backend.Provider == CASBackendInline {
// Inline CAS backend does not need validation
return
return nil
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 linter was complaining here

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
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.

Awesome! Looking forward to sharing our attestations in upcoming releases

@migmartri migmartri merged commit 36d453d into chainloop-dev:main Sep 4, 2023
11 checks passed
@migmartri migmartri deleted the 268-download branch September 4, 2023 13:48
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.

None yet

2 participants