Skip to content

Implement Phase 4 Authentication and API Requests in Cbrain-cli (Tasks 23–26)#50

Open
RafsanNeloy wants to merge 2 commits into
aces:mainfrom
RafsanNeloy:Auth_handle
Open

Implement Phase 4 Authentication and API Requests in Cbrain-cli (Tasks 23–26)#50
RafsanNeloy wants to merge 2 commits into
aces:mainfrom
RafsanNeloy:Auth_handle

Conversation

@RafsanNeloy

Copy link
Copy Markdown
Contributor

Contributor checklist

  • This pull request is on a separate branch and not the main branch
  • I ran pre-commit run --all-files and/or pytest as appropriate (see Tests in the README). A clean Ruff/pre-commit run is necessary but not sufficient—behavior still needs tests and review.
  • If CLI output changed intentionally, I updated capture_tests/expected_captures.txt
  • If command behavior changed, I checked normal, --json, and --jsonl output modes (or noted why not applicable)
  • Data-layer modules do not add direct print() calls for user-visible output
  • Public command names, flags, and default behavior remain compatible unless this PR explicitly documents a breaking change
  • No credentials, tokens, or session data appear in code, fixtures, logs, or this PR description

Type of change

  • Bug fix
  • New feature or command behavior
  • Documentation
  • Tests only
  • Other (describe below)

Description

Completes Phase 4 tasks 23–26, including CLI argument normalization, parser and execution separation, centralized API request handlings deferred authentication state loading during execution.

Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
@dlq

dlq commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for the substantial work here! The authentication-state changes are a strong improvement, the argument normalization looks good, and all unit, lint, and capture checks are passing.

Before we merge, could you please complete the API-client portion of Task 25? The plan calls for a small CbrainClient that stores the base URL, token, user ID, and timeout, and centralizes URL construction, HTTP methods, JSON parsing, and error handling. The current helper-function refactor is a useful step, but it doesn’t yet provide that client abstraction.

Alternatively, if the client is intended for a later PR, please update the title and description to say this completes Tasks 23 and 26 and partially addresses Task 25. Task 24’s parser separation was already present on main.

You’ve handled a broad refactor carefully, and the added tests give us good confidence. This final scope adjustment will make the work line up clearly with the project plan. 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