Repository navigation
refactor(account): use cli-core's shared CRM account remove and sign-in guard - #159
Merged
Merged
Conversation
…in guard Bitrix24's hand-written `account remove`, its --delete-data guard and the duplicate-webhook refusal at `session start` are replaced by cli-core's shared CRM ones (cli-core 0.722.0, NEED-2796 A). b24 keeps only what it must say itself: `held`, which reads the portal host and webhook user from the saved webhook and falls back to what `session start` remembered, and the sign-out words. `held` never swallows its own read failure: when the saved webhook cannot be read and nothing was remembered, it throws, and cli-core refuses --delete-data with `account-remove.account-unknown` instead of deleting a copy another profile still reads. For users: - `account-remove.portal-shared` (detail `portal`) is now `account-remove.account-shared` (detail `account`). - `--delete-data --dry-run` warns instead of failing. - `session.duplicate` carries `account` instead of `portal` and points to `session end`. - a webhook sign-in to a profile named `files` or `foreign-contacts` is refused with `profile.reserved`. Also bumps @wirecat/cli-core 0.710.0 -> 0.722.0 and @wirecat/cli-base 0.124.0 -> 0.127.0, and regenerates the command pages, the manifest, the help snapshot and the test matrix (account remove moves after search all). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
leemour
added a commit
that referenced
this pull request
Nov 24, 2026
…les were set opens its task The regression test runs the stage-tasks rules through the command against the fake portal, with the move in the same second the rules were set, as bin/b24-live does. The 0.27.0 section now also carries the shared account remove (#159). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
leemour
added a commit
that referenced
this pull request
Nov 24, 2026
* chore(release): 0.27.0 Raises the version to 0.27.0, a minor because the section has Added (client files, #154). The changes/ fragment is collected under the dated section. bin/b24-live --write now also puts a small PDF in the test deal's first file field, lists the deal's files and downloads that one, checking the saved bytes and the extracted text; then creates a test contact and company, lists their files and deletes them, and asks the portal that none is left. DESIGN.md and usage.md record what the live run showed: a file field's shape with original names, downloads from the portal host with no redirect, and documents listed with the crm scope alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(files): files permissions hold on api call; MCP names file text as data The fresh audit of 0.27.0 found that api call of the methods files reads through (crm.documentgenerator.document.list/get, crm.timeline.comment.*, disk.file.get) checked only its own api.* key, so files: deny could be got round. Each now also checks files.list or files.download (WC-PERM-22), with a regression row per method. The MCP server's list of untrusted text now names file names and downloaded file text (WC-MCP-11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(crm): cli-core 0.739.0, so a move in the second the stage-task rules were set opens its task The regression test runs the stage-tasks rules through the command against the fake portal, with the move in the same second the rules were set, as bin/b24-live does. The 0.27.0 section now also carries the shared account remove (#159). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(release): record the live check of 0.27.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): b24's MCP server offers schedule run, not schedule exec, as cli-core 0.739.0 does cli-core #3258 stopped offering `schedule exec` over MCP and limits it to the tool's own schedules folder; the pin in src/mcp.test.ts and docs/security.md still named it. The 0.27.0 changelog says so under "may break callers". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- 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.
Task
Use cli-core's shared CRM
account removeand sign-in guard, and drop b24's hand-written copy (owner decision NEED-2796 A, 2026-11-23; cli-core PR WireCatLabs/cli-core#3212, released in 0.722.0).Why
bitrix24-cli, amo-cli and hubspot-cli each kept about 110 lines of the same code: the removal for
accountRemoveCommand, a guard that refuses--delete-datawhile another profile reads the same copy, and a refusal of a second sign-in to the same account and user. cli-core now ships one, so a fix lands once for every CRM CLI.What
src/commands/account.tsnow holds onlyB24_ACCOUNT, theCrmAccountOptionspassed toaddCrmCommands({ account }):heldreads the portal host and webhook user from the saved webhook. When that read fails or nothing is saved, it uses the<host>:<userId>thatsession startremembered.heldthrows. cli-core then refuses--delete-datawithaccount-remove.account-unknown. It never returns "no account" for a profile that holds one, so it cannot delete another profile's copy.signedOutkeeps b24's words about the webhook or application staying in Bitrix24.session start(webhook) andsetup applycallrefuseTakenCrmAccountinstead of the localrefuseDuplicate.program.tsno longer mounts its ownaccount.src/reasons.tsdropssession.duplicateandaccount-remove.portal-shared, which now come from cli-core.@wirecat/cli-core0.710.0 → 0.722.0,@wirecat/cli-base0.124.0 → 0.127.0. Regenerated the command pages,contracts/wirecat.json, the help snapshot and the test matrix.account removenow sits aftersearch all, and cli-core's "Works with" list gains linear.For users (the changelog fragment is
changes/refactor-shared-account-remove.md):account-remove.portal-shared(detailportal) is nowaccount-remove.account-shared(detailaccount).--delete-data --dry-runwarns instead of failing.session.duplicatekeeps its reason. Its detailportalis nowaccount, and the message points tob24 <profile> session end.filesorforeign-contactsis refused withprofile.reserved.Not changed: the local-application sign-in (
session start --portal) still runs no duplicate or reserved-name check, as before.Testing
memoryKeyring()and temp folders, with nothing on the network:session startremembered;account-remove.account-unknown, and--keep-datastill works.vitest run: all pass.standards:check,lint,typecheck,lint:commands,audit:commands,contracts:check,contracts:upgrade,docs:check,generate:check,version:check,security:no-leak,package:check,test:matrix:check.🤖 Generated with Claude Code