chore(api): Only check CAS Backend status on needed endpoints#2420
Merged
javirln merged 3 commits intochainloop-dev:mainfrom Sep 8, 2025
Merged
chore(api): Only check CAS Backend status on needed endpoints#2420javirln merged 3 commits intochainloop-dev:mainfrom
javirln merged 3 commits intochainloop-dev:mainfrom
Conversation
…endpoints Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
d9f7d35 to
4007c05
Compare
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
jiparis
approved these changes
Sep 8, 2025
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR splits the
CheckOrgRequirementmiddleware in two.Middleware changes
ValidateCASBackend: Middleware in charge of checking the organization has configured a valid CAS backend and the credentials work. It does not block if the status of the middleware is invalid.BlockIfCASBackendNotValid: Checks the default middleware in the organization is valid and blocks the request if is not valid.This give us flexibility since there are some endpoints where we still want to check the status of the CAS backend without blocking the request if they are not valid and others where we want to directly block the request because they are needed.
Endpoint scope changes
BlockIfCASBackendNotValidapplies to only the following endpoints:API token handling
The middleware branch for API token authentication has also been updated. It now includes
ValidateCASBackendandBlockIfCASBackendNotValidonly when the operation requires a CAS backend. For example, with a failing CAS backend:Others
GetUploadCreds: It will run the validation on the CAS Backend of the workflow associated instead the default CAS Backend (it could have changed since att init was done)Init,Store: We cannot store even an attestation that is empty, so we validate them in those cases as well.