Skip to content

fix(cas-backend): Rotate credentials does not remove default flag#2417

Merged
javirln merged 1 commit intochainloop-dev:mainfrom
javirln:fix/cas-credentials-rotation
Sep 4, 2025
Merged

fix(cas-backend): Rotate credentials does not remove default flag#2417
javirln merged 1 commit intochainloop-dev:mainfrom
javirln:fix/cas-credentials-rotation

Conversation

@javirln
Copy link
Member

@javirln javirln commented Sep 3, 2025

This pull request refactors how the CLI handles updates to CAS Backend resources, specifically for the description and default fields. The main improvement is to only update these fields if the user explicitly sets the corresponding flags, preventing accidental overwrites with zero values.

CLI update logic improvements:

  • Added package-level pointer variables (isDefaultCASBackendUpdateOption, descriptionCASBackendUpdateOption) and helper functions (captureUpdateFlags, handleDefaultUpdateConfirmation) to ensure updates only occur when flags are explicitly set, and to centralize confirmation prompts for default backend changes. [1] [2]
  • Refactored update commands for all backend types (azure-blob, inline, oci, aws-s3) to use the new flag capture and confirmation logic, and to pass pointer values to update options. [1] [2] [3] [4]

Internal types and API updates:

  • Changed NewCASBackendUpdateOpts struct fields Description and Default to pointers, so unset fields are distinguishable from zero values.
  • Updated the CASBackendServiceUpdateRequest protobuf struct and its getter methods to use pointer types for Description and Default, supporting the new semantics in API requests. [1] [2] [3]

@javirln javirln changed the title WIP fix(cas-backend): Rotate credentials does not remoe default flag WIP fix(cas-backend): Rotate credentials does not remove default flag Sep 3, 2025
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln force-pushed the fix/cas-credentials-rotation branch from 6e12275 to c461da5 Compare September 4, 2025 08:44
@javirln javirln self-assigned this Sep 4, 2025
@javirln javirln marked this pull request as ready for review September 4, 2025 08:51
@javirln javirln changed the title WIP fix(cas-backend): Rotate credentials does not remove default flag fix(cas-backend): Rotate credentials does not remove default flag Sep 4, 2025
@javirln javirln merged commit 9ec4709 into chainloop-dev:main Sep 4, 2025
13 checks passed
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.

3 participants