Skip to content

fix(dashmate): use header authentication for ZeroSSL - #4419

Merged
shumkov merged 4 commits into
v4.1-devfrom
fix/zerossl-header-auth
Aug 19, 2026
Merged

fix(dashmate): use header authentication for ZeroSSL#4419
shumkov merged 4 commits into
v4.1-devfrom
fix/zerossl-header-auth

Conversation

@shumkov

@shumkov shumkov commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

ZeroSSL now recommends authenticating API requests with Authorization: ApiKey <access-key> because query-string credentials can leak through URL logs. Dashmate still placed its ZeroSSL key in every REST request URL.

Official announcement: https://zerossl.com/updates#publications/api-users-access-key-via-header-is-now-the-recommended-approach-for-authentication

What was done?

  • Move all seven Dashmate ZeroSSL REST operations to the exact recommended header.
  • Centralize case-insensitive header replacement, key validation, and request-option copying in the ZeroSSL request helper.
  • Keep non-auth query parameters, methods, request bodies, response mapping, and caller interfaces unchanged.
  • Prevent the key from entering request URLs or application-controlled error fields, including reflected object member names and malformed response errors.

This change is independent of #4415 and does not depend on its nullable-expiry behavior.

How Has This Been Tested?

  • Confirmed the focused contract produced 17 failures against the unfixed code.
  • yarn workspace dashmate exec mocha test/unit/ssl/zerossl/apiRequests.spec.js — 20 passing.
  • yarn workspace dashmate test:unit — 178 passing.
  • yarn workspace dashmate lint — 0 errors (43 pre-existing warnings).
  • Static scan confirms no production access_key remains under packages/dashmate/src/ssl/zerossl.
  • Independent correctness, security, reliability, adversarial, standards, and test reviews completed; post-fix review found no remaining issues.

Breaking Changes

None. Exported endpoint signatures, configuration, CLI behavior, and certificate workflow remain unchanged.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Move ZeroSSL credentials out of request URLs and into the recommended ApiKey Authorization header. Centralize header validation and sanitize reflected credential material before constructing errors.

Test would have caught this in CI: ✖ 17 focused failures before fix, ✔ 20 focused tests after fix; ✔ 178 Dashmate unit tests.
@github-actions github-actions Bot added this to the v4.1.0 milestone Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 36804f93-c2e0-48fb-9bf9-3492a7bd8d52

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 1 ahead in queue (commit 3a0d8eb)
Queue position: 2/3 · 1 review active
ETA: start ~17:35 UTC · complete ~17:50 UTC (median 15m across 30 recent reviews; 2 slots)
Queued 2m ago · Last checked: 2026-08-19 17:30 UTC

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Codex/Sol only (Phase 2 disabled)

At exact head cde8874, the production diff removes the ZeroSSL API key from all seven request URLs, adds one canonical case-insensitive Authorization header without mutating caller options, and sanitizes application-controlled response errors. The endpoint behavior and focused tests align with the PR goal, and no in-scope correctness or security findings were identified.

Source: Codex general reviewer backend gpt-5.6-sol; Codex security-auditor reviewer backend gpt-5.6-sol; final Codex verifier backend gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and is not reviewer evidence.

Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — security-auditor (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
  • Secondary pass: disabled (temporary_phase2_sonnet_disable)

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Codex/Sol only (Phase 2 disabled)

The ZeroSSL authentication changes correctly remove credentials from request URLs, centralize header authentication, preserve endpoint behavior, and sanitize response-derived errors. One in-scope documentation suggestion remains: delete the accidentally committed internal migration progress log, which contains stale and contradictory implementation states.

Source: Codex general reviewer backend gpt-5.6-sol; Codex security-auditor reviewer backend gpt-5.6-sol; final Codex verifier backend gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and not reviewer evidence.

Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — security-auditor (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
  • Secondary pass: disabled (temporary_phase2_sonnet_disable)

🟡 1 suggestion(s)

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `docs/ZEROSSL_HEADER_AUTH_STATUS.md`:
- [SUGGESTION] docs/ZEROSSL_HEADER_AUTH_STATUS.md:1-84: Remove the internal migration progress log
  This file is a chronological implementation log rather than durable project documentation. It preserves superseded states such as `BLOCKED`, says that source and tests were untouched, claims no commit or PR was made, and refers to a migration specification that the final commit removes. Those statements contradict the completed implementation and can mislead readers; delete this status artifact together with the removed specification.

Comment thread docs/ZEROSSL_HEADER_AUTH_STATUS.md Outdated
Comment on lines +1 to +84
STATUS: PROGRESS
WHAT: Verified the requested branch and base commit; beginning official-doc and repository-flow research.
NEED: nothing
NEXT: Verify ZeroSSL's current authentication contract and enumerate every Dashmate call, caller, helper, and test.

STATUS: FINDING
WHAT: ZeroSSL's current public REST overview and endpoint pages still require access_key query parameters; no public official page documenting Authorization: ApiKey was discoverable.
NEED: nothing
NEXT: Record the evidence conflict explicitly and design a conditional implementation gate around the newer announcement.

STATUS: FINDING
WHAT: Confirmed seven production wrappers and no existing wrapper/requestApi unit coverage; revokeCertificate currently has no repository caller.
NEED: nothing
NEXT: Compare authentication-injection seams and specify parameterized red-to-green request-contract coverage.

STATUS: PROGRESS
WHAT: Chose centralized header injection in the ZeroSSL-only requestApi helper; endpoint signatures and upstream callers remain unchanged.
NEED: nothing
NEXT: Write the evidence-gated design, exact request matrix, failure analysis, and TDD contract into the spec.

STATUS: DONE
WHAT: Completed the repository-grounded ZeroSSL header-auth spec with official-source conflict, centralized design, forward-port notes, and red-to-green request matrix.
NEED: Canonical ZeroSSL announcement or written support confirmation before implementation.
NEXT: Waiting for parent-orchestrated independent spec review and Ivan's alignment; no code work is authorized.

STATUS: PROGRESS
WHAT: Started independent coherence, feasibility, security, adversarial, and product reviews of the spec in two waves.
NEED: Nothing.
NEXT: Verify and fold review findings, then explain the reviewed plan and request Ivan's alignment before coding.

STATUS: FINDING
WHAT: Review confirmed invalid header errors can echo the key, case-variant Authorization values can combine, and reflected response errors can reach logs.
NEED: Nothing.
NEXT: Specify case-insensitive header ownership, generic local failures, exact-key response redaction, and adversarial tests.

STATUS: FINDING
WHAT: Public ZeroSSL docs still conflict with the supplied announcement; reviewers required a named evidence owner, terminal deferral path, and rollout validation.
NEED: Canonical ZeroSSL announcement or written ZeroSSL support confirmation.
NEXT: Fold the gate and operational decision path into the reviewed spec, then wait for Ivan's alignment and evidence.

STATUS: FINDING
WHAT: Second-pass review found that redaction must precede Error construction and malformed JSON parse errors must be replaced before they can quote reflected key material.
NEED: Nothing.
NEXT: Tighten the response-boundary contract and adversarial tests, then complete the reviewed-plan sync.

STATUS: BLOCKED
WHAT: Completed two-pass multi-agent review and folded verified findings; no production or test code was changed.
NEED: Canonical ZeroSSL announcement or written support confirmation, plus Ivan's explicit alignment with the reviewed plan.
NEXT: After both gates clear, write and run the failing request-contract tests, implement the centralized migration, verify green, and run independent code review.

STATUS: BLOCKED
WHAT: Ivan requested implementation and aligned on proceeding, but the mandatory ZeroSSL contract evidence gate remains unsatisfied; source and tests are untouched.
NEED: Canonical ZeroSSL announcement/account notice showing the exact header, or written ZeroSSL support confirmation for the scoped endpoints.
NEXT: On receipt, start with the failing request-contract tests, then implement, verify, and independently review the code.

STATUS: DONE
WHAT: Verified ZeroSSL's official 2026-08-17 update: header auth is live, URL access_key is deprecated, and the exact exclusive prefix is Authorization: ApiKey.
NEED: Nothing.
NEXT: Begin TDD implementation with the focused request-contract test failing against untouched production code.

STATUS: PROGRESS
WHAT: Added the focused request contract and confirmed 17 failures against untouched production code, including all seven credential-bearing URLs and error-boundary leaks.
NEED: Nothing.
NEXT: Implement centralized header injection and remove access_key from the seven endpoint URLs, then rerun the identical test.

STATUS: FINDING
WHAT: Independent code review found reflected error member names and leading key whitespace were not covered; both new regression cases failed before the follow-up fix.
NEED: Nothing.
NEXT: Redact member names, reject leading/trailing key whitespace, and rerun focused tests and lint.

STATUS: DONE
WHAT: Implemented header-only auth for all seven wrappers; 20 focused and 32 ZeroSSL unit tests pass, Dashmate lint has zero errors, and production access_key search is empty.
NEED: Full Dashmate unit discovery still requires the missing wasm-dpp build, which is blocked by a confirmed sccache Operation not permitted failure.
NEXT: Complete final post-fix review and hand off the uncommitted implementation; deployment still requires the spec's header-only read-only smoke check.

STATUS: DONE
WHAT: Independent post-fix security and test review is clean after strengthening Certificate conversion and sanitized-error shape assertions.
NEED: Nothing for the scoped implementation; the full-suite WASM/sccache prerequisite and deployment smoke check remain explicit handoff items.
NEXT: Waiting for commit/PR instructions; no commit, push, PR, or v4.2-dev change was made.

STATUS: DONE
WHAT: Rebuilt wasm-dpp with Homebrew LLVM and ran the complete Dashmate unit suite outside the sandbox; all 178 tests pass.
NEED: Nothing for repository verification; the deployment smoke check remains an operational handoff.
NEXT: Waiting for commit/PR instructions; no commit, push, PR, or v4.2-dev change was made.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Remove the internal migration progress log

This file is a chronological implementation log rather than durable project documentation. It preserves superseded states such as BLOCKED, says that source and tests were untouched, claims no commit or PR was made, and refers to a migration specification that the final commit removes. Those statements contradict the completed implementation and can mislead readers; delete this status artifact together with the removed specification.

source: ['codex']

@shumkov
shumkov merged commit 4d8f8ca into v4.1-dev Aug 19, 2026
13 checks passed
@shumkov
shumkov deleted the fix/zerossl-header-auth branch August 19, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants