Skip to content

Commit b6ef8cd

Browse files
cloudsmith-iduffycolinmoynes
authored andcommitted
fix: download command in the saml context (#283)
1 parent 5cf5a09 commit b6ef8cd

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

cloudsmith_cli/core/download.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -453,19 +453,8 @@ def stream_download( # noqa: C901
453453
if "Authorization" in request_headers and request_headers[
454454
"Authorization"
455455
].startswith("Bearer "):
456-
# SSO Bearer tokens don't work with /basic/ endpoints - need API key
457-
if not quiet:
458-
click.echo(
459-
"Warning: SSO authentication detected. Private repository downloads require an API key.",
460-
err=True,
461-
)
462-
click.echo("Options:", err=True)
463-
click.echo(
464-
" 1. Set environment variable: export CLOUDSMITH_API_KEY=your_api_key",
465-
err=True,
466-
)
467-
click.echo(" 2. Use command option: --api-key YOUR_KEY", err=True)
468-
# Remove Authorization header since it won't work
456+
bearer_token = request_headers["Authorization"].split("Bearer ", 1)[1]
457+
auth = ("token", bearer_token)
469458
request_headers = {
470459
k: v for k, v in request_headers.items() if k != "Authorization"
471460
}

0 commit comments

Comments
 (0)