Skip to content

Detect unconfigured E2E setup and unauthorized chunk uploads in CLI - #429

Merged
Forceu merged 1 commit into
Forceu:masterfrom
bauerpawel:feat/cli-e2e-not-setup-detection
Sep 12, 2026
Merged

Forceu merged 1 commit into
Forceu:masterfrom
bauerpawel:feat/cli-e2e-not-setup-detection

Conversation

@bauerpawel

Copy link
Copy Markdown
Contributor

Description

Two small CLI uploader error-detection improvements found while going through its outstanding // TODO markers:

  • cliapi.GetE2eInfo failed decryption with an opaque ErrE2eKeyIncorrect-style error whenever a server hadn't had end-to-end encryption set up at all yet — indistinguishable from actually entering the wrong key. It now checks result.HasBeenSetUp() first and returns a distinct ErrE2eNotSetUp, and cliconfig.go's login flow reports that case with a clear, actionable message instead.
  • uploadChunk treated a 401 Unauthorized chunk-upload response the same as any other non-200 status, printing a generic "status code 401" message. It now translates that into the existing ErrUnauthorised sentinel, matching how the rest of the CLI already reports auth failures.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Technical Details

  • Database changes: No
  • Storage backend affected: No
  • Usage of AI: Yes — developed with Claude Code as a pair-programming assistant. I reviewed and tested all changes before submitting.

How Has This Been Tested?

  • Manual Testing: Verified the login flow's error output against a server with no E2E setup, and confirmed a 401 during a chunked upload now reports the same "Unauthorised API key" message as other auth failures.
  • Unit Tests: go test ./... --tags=test,awsmock (full suite passes; cmd/cli-uploader has no existing test files to extend)
  • Environment: Windows 11

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation. (n/a — CLI error-message wording only)
  • My changes generate no new warnings.

🤖 Generated with Claude Code

https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d

…ds in CLI

- GetE2eInfo now returns a distinct ErrE2eNotSetUp when end-to-end
  encryption hasn't been set up on the server yet, instead of falling
  through to a generic decryption failure. cliconfig.go's login flow
  reports this with a clear message instead of an opaque error.
- uploadChunk now translates a 401 response into ErrUnauthorised
  instead of a generic "status code 401" error message.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168YUwGEzEHTqd9CwzXE53d
@Forceu
Forceu merged commit c78dafc into Forceu:master Sep 12, 2026
1 check passed
@Forceu

Forceu commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Thank you!

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