Commit Graph

111 Commits

Author SHA1 Message Date
github-actions[bot] f70d1fc375 Version Packages (#160)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@stripe/link-cli@0.7.4
2026-06-15 12:37:31 -04:00
jlau-stripe c2fc0659ee v0.7.4 changeset (#159) 2026-06-15 12:00:14 -04:00
nvp-stripe d5044ed5e8 Add link_pay_token field to SpendRequest type (#158)
* add field

* retrieve.tsx updat
2026-06-12 14:12:08 -04:00
kreese-stripe 78f0200ad7 --approve flag for calling delegated endpoint (#154) 2026-06-12 11:47:38 -04:00
github-actions[bot] 67da9a4522 Version Packages (#152)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@stripe/link-cli@0.7.3
2026-06-10 14:51:20 -04:00
kreese-stripe f83d5cc332 v0.7.3 changeset (#151) 2026-06-10 14:42:14 -04:00
kreese-stripe a87ff0cbe4 feat: update SR max amount (#147)
* update SR max amount

* fmt

* trigger ci

* trigger ci
2026-06-10 12:31:40 -04:00
drapeau-stripe 5521060e19 sdk: add report resource for agent observability (#114)
Add IReportResource interface and ReportResource implementation that
POSTs to /agent_observations. Supports reporting purchase outcomes
(success, blocked, abandoned) with domain, tags, and context.
2026-06-10 09:02:28 -07:00
kreese-stripe e09d499424 Update documented limits (#146) 2026-06-10 10:30:59 -04:00
github-actions[bot] a34aaf9f1c Version Packages (#145)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@stripe/link-cli@0.7.2
2026-06-08 14:06:09 -04:00
kreese-stripe a30d70bef0 feat: changeset for v0.7.2 (#144)
* pnpm changeset for v0.7.2

* update changeset

* rm old changeset
2026-06-08 14:02:57 -04:00
kreese-stripe 06cc528175 fix: Align on minimum node version requirements across configs (#142)
* Align on minimum node version requirements across configs

* fmt
2026-06-08 13:03:09 -04:00
kreese-stripe 51b0251cd7 feat: Upload SEAs to release artifacts as well (#143)
* Upload SEAs to release artifacts as well

* Updates to SEA Build config

* Fixes to get the SEA builds working

* SEA-specific build config

* revert unneeded changes
2026-06-08 12:50:25 -04:00
github-actions[bot] 328b9d6568 Version Packages (#141)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@stripe/link-cli@0.7.1
2026-06-05 14:27:27 -04:00
kreese-stripe 13fda7edd1 feat: v0.7.1 changeset (#140) 2026-06-05 14:24:09 -04:00
kreese-stripe b9b41e7aef Upload built cli.js with checksum as release artifact (#139) 2026-06-05 14:02:07 -04:00
kreese-stripe 61303becbe publishable update (#138) @stripe/link-cli@0.7.0 2026-06-05 10:48:53 -04:00
kreese-stripe 079c41da00 pnpm changeset (#137) 2026-06-05 10:39:18 -04:00
jlau-stripe 9d5969df12 Support additional endpoints to auth by env access_token (#134)
* Support additional endpoints to auth by env access_token

* Add tests

* fix formatting
2026-06-03 11:00:47 -04:00
nvp-stripe 31421c6c78 feat(sdk): migrate WebBotAuthResource to POST /web_bot_auth/sign (#122)
* feat(sdk): migrate WebBotAuthResource to POST /web_bot_auth/sign

PR #2208449 (pay-server) added a dedicated signing endpoint. The
credentials endpoint no longer accepts the url parameter or returns
web_bot_auth. Update the SDK resource to call the dedicated endpoint.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

* code review comments

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 09:22:51 -04:00
sylwang7 6ea4fbe360 Add payment_status_details to spend request retrieve (#124)
* surface payment_status_details from spend request retrieve API

* fix inline test bold element
2026-06-01 15:05:18 -04:00
kreese-stripe 2049933177 clear any existing auth when calling auth login (#130) 2026-05-29 13:00:39 -04:00
Dan Hill 35023ae48c fix: bump versions to latest (#132) 2026-05-29 12:13:28 -04:00
Dan Hill 560d92238a Cursor plugin (#131)
* feat: add Cursor plugin manifest

Committed-By-Agent: claude

* feat: add Cursor plugin MCP server config

Committed-By-Agent: claude

* feat: add Cursor plugin agent definition

Committed-By-Agent: claude

* feat: add Cursor plugin README

Committed-By-Agent: claude

* fix: cleanup and sync

* fix: biome cleanup
2026-05-29 12:08:09 -04:00
jliwag-stripe 9e1fe045d2 Update issue-triggered-create-jira.yml (#123)
I've added retry mechanism, 4 retries with 15min delay per retry and if retry maxed out it will ping the Slack channel. The code has been tested on my private test repo.
2026-05-28 13:44:45 -07:00
Dan Hill a96c507046 feat: bump to version 0.6.0 (#126) @stripe/link-cli@0.6.0 2026-05-28 16:14:51 -04:00
Dan Hill 18d19579a4 fix: hide web-bot-auth until ready (#125) 2026-05-28 16:07:05 -04:00
Dan Hill fe45662873 HTTP mcp (#121)
* feat: add serve command to expose MCP endpoint over HTTP

Committed-By-Agent: claude

* fix: cleanup and readme

* Potential fix for pull request finding 'CodeQL / Information exposure through a stack trace'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-05-28 15:45:53 -04:00
harryguo-nyc 2639339bfc feat: add spend-request list command (#108)
* feat: add spend-request list command

Implements `spend-request list` subcommand that calls GET /spend_requests,
unwraps the response, and renders active spend requests grouped by status
with color coding. Includes SDK interface update, implementation, Ink UI
component, subcommand registration, and unit/integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

* fix: correct onComplete type in SpendRequestList to accept null

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

* fix: apply biome formatting to list command files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

* fix: call exit() after list completes so interactive mode terminates

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

* fix: apply biome formatting to useAsyncAction destructure in list.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:34:27 -04:00
Dan Hill 0783323004 WIP: auth from env (#107)
* feat: add noRefresh option to createAccessTokenProvider

Committed-By-Agent: claude

* feat: add env-based token provider to ResourceFactory

Committed-By-Agent: claude

* feat: read LINK_ACCESS_TOKEN, LINK_REFRESH_TOKEN, LINK_NO_REFRESH from env

Committed-By-Agent: claude

* docs: add LINK_ACCESS_TOKEN, LINK_REFRESH_TOKEN, LINK_NO_REFRESH to env vars docs

Committed-By-Agent: claude

* fix: auth status shows LINK_ACCESS_TOKEN state instead of stored credentials

Committed-By-Agent: claude

* refactor: extract resolveAuthInfo helper, simplify auth status component

Committed-By-Agent: claude

* fix: formatting
2026-05-27 10:04:43 -04:00
Dan Hill 5d76bf614d feat: document current limits (#104) 2026-05-27 09:00:10 -04:00
Gus d6efd70e01 security: refuse to write credentials through pre-existing symlinks (#94)
* security: refuse to write credentials through pre-existing symlinks

writeCredentialFile (cli/src/utils/credential-output.ts) was vulnerable to
a TOCTOU exfiltration on shared filesystems. The previous flow was:

  fs.access(resolved)         // follows symlinks
  fs.writeFile(resolved, ..., { mode: 0o600 })  // follows symlinks; mode
                                                // applied only if file is
                                                // created, not if exists
  fs.chmod(resolved, 0o600)   // follows symlinks; sets perms on TARGET

If the operator runs `spend-request retrieve <id> --output-file <path>
--force` and an attacker on the same filesystem (CI runner, multi-tenant
host, container with shared /tmp) pre-plants a symlink at <path> pointing
at a file the attacker can already read, the attacker:

  1. Plants <path> as a symbolic link to /tmp/<readable>.
  2. Opens a read fd on /tmp/<readable> while it is world-readable.
  3. Operator runs the command: writeFile follows the symlink and writes
     the full card credential (PAN, CVV, billing address, valid_until) to
     the symlink target.
  4. Operator's chmod 0o600 then locks the target down — too late, the
     attacker's fd was opened before the chmod and survives it.

Verified end-to-end by a Node reproduction: a fresh fd opened against the
target before the operator's writeCredentialFile call reads the JSON-
encoded credential immediately after the call returns, regardless of the
chmod that follows.

Fix replaces fs.access + fs.writeFile + fs.chmod with a single
fs.open(resolved, O_CREAT | O_EXCL | O_WRONLY | O_NOFOLLOW, 0o600). The
mode is set at create time. O_NOFOLLOW makes open fail with ELOOP if the
final path component is a symlink. O_EXCL makes open fail with EEXIST if
the file already exists. Force-mode unlinks any pre-existing entry first
(operating on the symlink itself via fs.unlink, not the target via
fs.writeFile), then takes the same atomic-create path.

Tests added to credential-output.test.ts:
- refuses to write through a symbolic link without force
- refuses to write through a symbolic link with force (target untouched)
- TOCTOU race-fail-closed
- 0o600 mode produced even with --force (regression guard for the
  removed fs.chmod step)

`pnpm test` is green (117/117 across 11 files). Negative control: with
the implementation reverted, two of the new tests fail because the
symlink target is overwritten by the credential JSON.

* security(credential-output): scope POSIX-only protection explicitly

Addresses review feedback on PR #94. Gates O_NOFOLLOW as
constants.O_NOFOLLOW ?? 0 with an inline note on the Windows gap
(O_EXCL still prevents overwriting a pre-existing entry, but the path
no longer provides full no-follow protection there). Trims in-file
comment; the full attack chain stays in the PR body and tests. Drops
the biome-ignore directive that pointed at a non-existent rule.

* security(credential-output): refuse symlinks even with --force

Addresses review feedback on PR #94. The previous revision unlinked any
pre-existing entry in --force mode and then ran the atomic open with
O_EXCL | O_NOFOLLOW. That cleared the path for the create but also
silently destroyed pre-existing symlinks, and the no-follow guarantee
only covered the race window after the unlink.

This refactor inverts the precheck: lstat first, refuse outright when
the final path is a symlink (with or without --force), and only unlink
and recreate for non-symlink existing files. O_EXCL | O_NOFOLLOW remains
the race defense between the precheck and the atomic create.

Tests updated. The without-force symlink case now expects
OUTPUT_FILE_SYMLINK and asserts the symlink survives. The with-force
case is renamed to make the new contract obvious and gets the same
assertions. The dedicated post-unlink-race test is dropped because its
premise (force unlinks the symlink) no longer applies; the regular-file
race defense is exercised by the existing 0o600 test.
2026-05-27 08:54:28 -04:00
Arpit Jain 1bdbbe69eb ci: declare contents:read on CI workflow (#102)
CI builds, typechecks, runs biome and pnpm tests, and finally
`pnpm publish --dry-run`. None of these reach beyond the working
tree. Declaring contents:read at workflow scope makes that intent
explicit and matches the workflow-level permissions blocks that
release.yml and issue-triggered-create-jira.yml already carry.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-05-22 11:49:35 -04:00
kreese-stripe 27b3de936a feat: support polling straight from auth login (#78)
* support polling straight from auth login

* improvements

* sanitize output; make the polling into a shared helper and share across the auth login polling and the auth status polling
2026-05-21 13:24:55 -04:00
nvp-stripe bed025fb36 Add web-bot-auth sign <url> command (#106)
* web bot auth command

* improve tests
2026-05-20 20:05:29 -04:00
nvp-stripe cc4adb28bf feat(sdk): add WebBotAuthResource for Web Bot Auth header minting (#105)
* added WebBotAuth changes

* code quality improvements

* fix build error

* address CR comments
2026-05-20 10:08:40 -04:00
Dan Hill 0cd466dbe9 fix: remove build numbers (#103) 2026-05-18 14:07:45 -04:00
Dan Hill baa5aabf1d Bump to 0.5.0 publish (#99) @stripe/link-cli@0.5.0 2026-05-11 16:05:25 -04:00
Dan Hill 4121c7b5cd Bump to 0.5.0 (#97) 2026-05-11 15:37:51 -04:00
kreese-stripe 8a194d914e Update the docs for totals to reflect new accepted values (#96) 2026-05-11 11:08:10 -04:00
bendavis-stripe 0387b25ee6 fix: sanitize server-returned text to prevent ANSI escape injection (#85)
Server-returned string fields (merchant_name, line_items[].name,
billing_address.*, payment method brand/nickname) are now sanitized
before rendering in Ink components using strip-ansi plus control
character stripping. This prevents terminal escape sequence injection
that could spoof the approval UI.


Committed-By-Agent: claude

Co-authored-by: Ben Davis <ben@bencdavis.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-10 15:38:29 -04:00
Shubham Mathur f455286336 fix: CLI Approval Polling Bugs (surfaced by #63) (#95)
* fix: recognize all terminal statuses in approval polling

* fix: extend default spend-request polling window past server-side expiry
2026-05-10 15:38:12 -04:00
Dan Hill a8a8933cfa fix: swallowing mpp errors (#93) 2026-05-08 17:46:35 -04:00
Dan Hill 90c88cf397 fix: apply improvements to new code areas (#92) 2026-05-08 13:58:43 -04:00
Dan Hill f793732327 Render interactive helper (#88)
* refactor: extract renderInteractive helper to reduce command boilerplate

Committed-By-Agent: claude

* fix: address review findings for renderInteractive helper

Committed-By-Agent: claude

* fix: resolve biome lint and formatting errors

Committed-By-Agent: claude
2026-05-08 13:01:21 -04:00
Dan Hill 6c0f92ffc3 Add versioning to the skill file (#91)
* feat: add versioning to the skill file

* fix: formatting
2026-05-08 12:53:44 -04:00
Dan Hill f0b391dc90 Use async action hook (#89)
* refactor: extract useAsyncAction hook for async command components

Committed-By-Agent: claude

* fix: add cleanup, ref stability, and safer error handling to useAsyncAction

Committed-By-Agent: claude

* fix: cleanup
2026-05-08 12:50:00 -04:00
Dan Hill de0aa8ddb2 Poll until utility (#90)
* refactor: extract pollUntil utility to consolidate polling logic

Committed-By-Agent: claude

* fix: address review findings for pollUntil utility

Committed-By-Agent: claude

* fix: handle timeout=0 correctly in pollUntil (immediate deadline)

Committed-By-Agent: claude

* fix: resolve biome formatting

Committed-By-Agent: claude
2026-05-08 12:46:53 -04:00
Dan Hill 281b61c38b Specify credential file (#81)
* feat: allow specifying a credential file

* copy cleanup

* fix: make flag clearer
2026-05-08 12:33:40 -04:00
Dan Hill cd53dbee6d Refactor Auth (#87)
* refactor: apply requireAuth uniformly across all authenticated commands

Committed-By-Agent: claude

* refactor: use incur middleware for auth on non-generator commands

Use middleware: [requireAuth] on update, cancel, list, add, pay.
Use requireAuthGuard(c) inline for generator commands (create,
request-approval, retrieve) due to incur limitation with middleware
+ async generators + c.error() return values.

Committed-By-Agent: claude
2026-05-08 12:18:36 -04:00