Repository navigation
Let reconcile observe M-Team (API key) and use the saved site credential - #29
Merged
Merged
Conversation
reconcile report read live site detail only with a piped cookie, so --site-ref mteam/ID was refused. It now takes: - --site-live: the credential 'ptctl site login' saved for the site, read after every credential-free gate; with a downloader, stdin then carries only the --password-stdin downloader password - --site-api-key-stdin: a piped API key for API-key sites - site_api_key in the --credential-bundle-stdin bundle, in place of site_cookie (exactly one of the two) A site credential of a method the site does not accept is a usage error before any request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reconcile report --site-ref mteam/IDwas refused because live site detail read only a piped cookie. This adds:--site-live: uses the credentialptctl site loginsaved for the site. Nothing is read from stdin for the site; it is read only after every credential-free gate passes. With a downloader in the same command,--site-live --password-stdinleaves stdin to the downloader password alone.--site-api-key-stdin: pipes an API key, for API-key sites (M-Team).site_api_keyin the--credential-bundle-stdinbundle: allowed in place ofsite_cookie. Exactly one of the two must be present.A site credential whose method the site does not accept is a usage error before any request. For a bundle, this is checked after the read, and still before any request.
Deliberate public-text changes
combined live site and downloader reads require --credential-bundle-stdin. It is now... require --credential-bundle-stdin, or --site-live with --password-stdin.--site-cookie-stdin, --site-api-key-stdin, or --site-live.--site-cookie-stdin, --site-api-key-stdin, --site-live, and --credential-bundle-stdin are mutually exclusive--site-live cannot be explicitly disabledcombined --site-live and downloader reads require --password-stdinsite %q does not support %s authentication, now also from reconcile--credential-bundle-stdinflag description mention the new flags and field.Report JSON, stop reasons, exit codes, route IDs and origins are unchanged. The existing cookie and bundle paths behave as before.
Tests
internal/cli/reconcile_site_credentials_test.gocovers:--site-livewith a saved cookie and with a saved API key, without reading stdin;--site-liveplus qBittorrent, where stdin carries only the downloader password;site_api_key;--site-live=false, a wrong method, a missing saved file,--site-liveplus a client without--password-stdin, and a stdin site credential plus a client;All fixtures are synthetic canaries.
Live check
I ran this against M-Team with a throwaway HOME, the API key saved by
site login --api-key-stdin, a synthetic one-file torrent and stdin set to/dev/null:reconcile report --site-ref mteam/<public id> --site-liveobserved_current_ref, originhttps://api2.m-team.cc, routemteam.torrent_detail_api.v1, one request.Docs
docs/guide/reconcile.mddocs/AUTOMATION.mddocs/MTEAM_ADAPTER.md: the new Reconciliation section; it is removed from "Not supported yet".docs/ADDING_A_SITE.md: the gap table; the remaining cookie-only checks are in the bonus commands.docs/ARCHITECTURE.mddocs/TJUPT_ADAPTER.mddocs/THREAT_MODEL.md🤖 Generated with Claude Code