Skip to content

fix(cli): handle inline PEM CA content in artifact download#3013

Merged
javirln merged 1 commit intochainloop-dev:mainfrom
javirln:javirln/fix-artifact-ca-pem
Apr 9, 2026
Merged

fix(cli): handle inline PEM CA content in artifact download#3013
javirln merged 1 commit intochainloop-dev:mainfrom
javirln:javirln/fix-artifact-ca-pem

Conversation

@javirln
Copy link
Copy Markdown
Member

@javirln javirln commented Apr 9, 2026

The artifact download command unconditionally passed the CAS CA config value to WithCAFile(), which calls os.ReadFile() and fails with "file name too long" when the config contains inline PEM content (as set by the enterprise install script) instead of a file path.

This applies the same os.Stat() check already used in root.go and action.go to distinguish file paths from inline PEM content, routing to WithCAFile or WithCAContent accordingly.

The artifact download command unconditionally passed the CAS CA config
value to WithCAFile(), which fails with "file name too long" when the
value contains inline PEM content instead of a file path. Use os.Stat()
to distinguish paths from PEM content, matching the existing pattern in
root.go and action.go.

Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
@javirln javirln self-assigned this Apr 9, 2026
@javirln javirln requested review from jiparis and migmartri April 9, 2026 09:44
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@javirln javirln merged commit b81f027 into chainloop-dev:main Apr 9, 2026
15 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.

2 participants