Skip to content

feat(auth-curl): add --max-time / --connect-timeout passthrough to curl - #4

Merged
pchuri merged 1 commit into
mainfrom
fm/authcurl-maxtime-w1
Jul 26, 2026
Merged

pchuri merged 1 commit into
mainfrom
fm/authcurl-maxtime-w1

Conversation

@pchuri

@pchuri pchuri commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Adds --max-time <seconds> (and the commonly-paired sibling --connect-timeout <seconds>) to the auth-curl command, passing the value straight through to the underlying curl invocation.

auth-curl advertises itself as "curl with automatic Chrome cookie authentication", so tools that generate invocations naturally assume it mirrors curl's common flags. Before this change, auth-curl --max-time 20 "URL" failed with error: unknown option '--max-time' (exit 1).

This unblocks generated auth-curl --max-time calls — context: a watchtell alarm checker generates such invocations and was erroring out.

Changes

  • New commander options --max-time <seconds> and --connect-timeout <seconds>.
  • Both values are validated as positive numbers; invalid input (e.g. --max-time notanumber) fails cleanly with a clear message and non-zero exit instead of passing garbage to curl.
  • When present, --max-time N / --connect-timeout N are forwarded into the built curlArgs.
  • Documented in --help examples and the README (auth-curl section + options table).
  • New tests/auth-curl.test.ts asserting --max-time 20 appears in the built curl command, plus the sibling flag, absence, and invalid-input cases. Tests mock/inspect the built curl args — no live network or real cookies.

Testing

  • npx jest — 39 tests pass (8 suites).
  • tsc --noEmit clean; eslint 0 errors (pre-existing warnings only).

Notes

  • Surgical change: only the new options + passthrough + validation + docs + a test. No refactor of the cookie/curl logic.
  • The security CI job (npm audit) may show red for an unrelated, known reason (tracked separately as cce-ci-audit-fix); the test checks must pass.

🤖 Generated with Claude Code

…curl

auth-curl advertises itself as "curl with automatic Chrome cookie
authentication", so tools that generate invocations naturally assume it
mirrors curl's common flags. Passing `auth-curl --max-time N` previously
failed with "unknown option".

Add `--max-time <seconds>` and the sibling `--connect-timeout <seconds>`
options, validate they are positive numbers (clean non-zero exit on
invalid input), and forward them into the underlying curl command.
Documents both flags in --help examples and the README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pchuri
pchuri merged commit 5e46715 into main Jul 26, 2026
3 of 4 checks passed
@pchuri
pchuri deleted the fm/authcurl-maxtime-w1 branch July 26, 2026 07:45
github-actions Bot pushed a commit that referenced this pull request Jul 26, 2026
# [1.2.0](v1.1.1...v1.2.0) (2026-07-26)

### Bug Fixes

* **decryptor:** correct macOS v10 cookie decryption (wrong key + M130 domain hash) ([#3](#3)) ([f4f6ed5](f4f6ed5))

### Features

* **auth-curl:** add --max-time and --connect-timeout passthrough to curl ([#4](#4)) ([5e46715](5e46715))
* **auth-curl:** forward unknown curl flags to the underlying curl ([#6](#6)) ([6739734](6739734))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant