GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — feat(config): socket login now configures socket-patch — socket-cli config.json fallback + SOCKET_CLI_* aliases by mikolalysenko · Pull Request #125 · SocketDev/socket-patch Conversation
Collaborator
SummaryAligns socket-patch's configuration with the JS Socket CLI so one Per-key resolution for the three auth settings: What's in here
Test hermeticity (important for reviewers)A developer's real Testing
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…ve in core api_url/proxy_url become Option<String> with no default_value so api_client_overrides() forwards None when neither flag nor env var is set. get_api_client_with_overrides already owns env → default resolution, and this makes room for the socket-cli config fallback layer between env and the built-in defaults. Parse-time contract tests now pin None; the documented URLs stay pinned in core's resolver tests. Co-Authored-By: Claude Fable 5 <[email protected]> …ayer New socket_patch_core::utils::socket_cli_config reads the JS socket-cli login state (<data dir>/socket/settings/config.json, base64 JSON, read-only) and exposes it as the resolution layer below env vars and above built-in defaults for apiToken/defaultOrg/apiBaseUrl. One 'socket login' now configures socket-patch too. - get_api_client_with_overrides: flag > env > config > default per key; SOCKET_NO_API_TOKEN vetoes ambient tokens (env+config, explicit --api-token still wins); SOCKET_NO_CONFIG disables the layer. - telemetry: resolve_telemetry_endpoint now shares resolve_api_base_url() with client construction so the two can't disagree about the API host. - env_compat: SOCKET_CLI_API_TOKEN / SOCKET_CLI_ORG_SLUG / SOCKET_CLI_API_BASE_URL / SOCKET_CLI_NO_API_TOKEN accepted as silent peer aliases (canonical SOCKET_* names win; no deprecation warning). - corrupt/unreadable config warns once on stderr and is ignored; missing file is silent; --json stdout purity unaffected. Co-Authored-By: Claude Fable 5 <[email protected]> …ck layer - .cargo/config.toml [env] exports SOCKET_NO_CONFIG=1 so a developer's real 'socket login' can never authenticate a test run; every env scrub loop in the e2e harnesses now skips SOCKET_NO_CONFIG so the guard survives into spawned binaries, and targeted token scrubs also drop SOCKET_CLI_API_TOKEN. - new tests/cli_config_fallback.rs (9 cases): config token/apiBaseUrl authenticate, defaultOrg skips org auto-resolve with telemetry following the config host+token, per-key env-beats-config, alias honored + canonical wins, corrupt config warns on stderr with --json stdout still parseable, SOCKET_NO_CONFIG gate, SOCKET_NO_API_TOKEN veto incl. --api-token surviving it, missing file silent. - client.rs unit tests for the veto (ambient suppressed, override wins). Co-Authored-By: Claude Fable 5 <[email protected]> - docs/design/configuration.md: the settled configuration model — per-key precedence (flag > env > SOCKET_CLI_* alias > socket-cli config.json > default), read-only pledge, rejected alternatives (.env loading, new config file, repo-level endpoints/credentials), and deferred items (manifest setup.defaults, the env cleanup sweep, token-file/keychain sourcing). - README: 'Configuration sources' subsection under Global Options. - CLI_CONTRACT: peer-alias paragraph, config-layer toggles table, and a 'Persisted configuration' section with contract properties incl. 'repo-level files never carry endpoints/credentials/interlocks'. - CHANGELOG: Unreleased Added + Changed entries. Co-Authored-By: Claude Fable 5 <[email protected]> Older socket-cli releases wrote the Linux-style data dir on every platform — real macOS logins exist at ~/.local/share/socket/settings/ config.json (verified on a dev machine where ~/Library/Application Support/socket/settings/ exists but is empty). With XDG_DATA_HOME unset, macOS now probes the native Application Support path first and the legacy path second; first existing file wins, and a corrupt preferred file stops the probe rather than silently resurrecting older credentials from the fallback location. Co-Authored-By: Claude Fable 5 <[email protected]> …config-alignment Conflict: cli_parse_apply.rs defaults comment — kept main's --yes example (--break-lock is gone) and this branch's api_url/proxy_url None pins. Co-Authored-By: Claude Fable 5 <[email protected]>
Mikola Lysenko (mikolalysenko)
enabled auto-merge (squash)
Wenxin Jiang (Wenxin-Jiang)
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Mikola Lysenko (mikolalysenko)
deleted the
feat/socket-cli-config-alignment
branch
Mikola Lysenko (mikolalysenko)
added a commit
that referenced
this pull request
…h/config alignment (#127) * feat!: remove unlock + --break-lock, fold lock cleanup into repair, reorder --help v4 breaking CLI cleanup, part 1: - Remove the `unlock` subcommand. A leftover apply.lock from a crashed run never blocks acquisition (the kernel releases a dead holder's advisory lock), so unlock's inspect path had no recovery scenario and its --release file deletion is now automatic in repair. The patch_unlocked/patch_unlock_failed telemetry events, Command::Unlock envelope variant, and SOCKET_UNLOCK_RELEASE are retired with it. - Remove the global --break-lock flag and SOCKET_BREAK_LOCK. It never stole a live holder's lock (deliberately), and stale files never contend, so all it did was emit a lock_broken audit event for a reclaim plain acquisition performs anyway. acquire_or_emit now returns the LockGuard directly; the lock_held hint advises waiting / --lock-timeout. rollback's warnings[] stays present, now always empty. The never-unlink-while-live invariant survives, pinned by acquire_or_emit_preserves_mutual_exclusion. - repair deletes the leftover apply.lock as its final housekeeping step on every completion path (after releasing its own guard; skipped on --dry-run; live holders still refused with lock_held exit 1). - Reorder --help to workflow-first: scan, apply, vex, vendor, setup, rollback, get, list, remove, repair. CHANGELOG carries migration notes under [Unreleased]; the 4.0.0 version-sync is deferred to batch with the remaining breaking changes. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: README overhaul on the Divio model + docs/ecosystems.md split README rewritten as pitch → install → five-minute tutorial → explanation → how-to recipes → full command reference. Ecosystem/mode support matrix, Maven/NuGet/Rush/Go/Cargo caveats, and platform table move to the new docs/ecosystems.md. 83 defects fixed across a 5-round adversarial review (stale claims, inverted --strict default, .socket/blobs/ path, unimplemented --one-off stubs labeled, live-tested [email protected] tutorial). CLI_CONTRACT.md maven service-coverage passage synced to SERVICE_ECOSYSTEMS. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: port PR #125 auth/config model into the rewritten README Configuration sources subsection under Global options (per-key precedence: flag > SOCKET_* env > SOCKET_CLI_* alias > socket-cli config.json > default, config-file locations, SOCKET_NO_API_TOKEN / SOCKET_NO_CONFIG toggles, read-only + no-.env pledge), socket-login-first --api-token row, anonymous public-proxy path kept prominent in the tutorial intro, configuration.md linked from Further reading. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: round-6 review fixes — auth section structure + CI auth guidance Re-nest Configuration sources as an H4 inside Global options after the flags table (the insert had stranded the table inside the wrong section); fold the SOCKET_CLI_* aliases into the env-var rung so the ladder matches the contract's one-extra-layer model; XDG-first config paths on Linux+macOS; labeled url default; CI authentication paragraph (SOCKET_API_TOKEN secret, paidRequired fallback behavior, SOCKET_NO_API_TOKEN pin); slimmer --api-token row; Maven/NuGet experimental-discovery breadcrumb in the tutorial; socket-patch vs Socket CLI disambiguation and wrap fixes. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: fix repair --offline example comment — warn-and-skip, not per-entry failure Verified against repair.rs: offline mode prints a summary warning for missing artifacts, records no download events, and exits success. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |