Skip to content

feat(auth): report helper credential outcomes back to Git - #3818

Merged
Daniel Meppiel (danielmeppiel) merged 8 commits into
mainfrom
danielmeppiel-0370-credential-approve-reject
Nov 18, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 8 commits into
mainfrom
danielmeppiel-0370-credential-approve-reject

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TL;DR. When the Azure DevOps auth chain uses a credential from git credential fill, APM now reports the outcome back to the user's credential helper, as Git does: approve after the operation succeeded, reject once after a verified HTTP 401 for that exact credential. Git Credential Manager can then replace an expired credential instead of offering it again on every run. Ambiguous outcomes (403, sign-in redirect or page, not-found, throttle, network, TLS) are never reported, and env PATs, az bearers and gh/non-ADO credentials are never reported. Stacked on #3790 (owner of the chain and the classifier).

Problem (WHY)

  • fix(auth): route every Azure DevOps egress through one auth chain owner #3790 made the ADO chain ask the helper (decision D3 deferred the rest of the contract) and added a guard that APM "must never call git credential approve or reject".
  • The git-credential contract step 4: "If the credential allowed the operation to complete successfully, then it can be marked with an "approve" action ... If the credential was rejected during the operation, use the "reject" action so that git credential will ask for a new password in its next invocation."
  • Without reject, a dead stored credential keeps being returned by fill, so every install re-sends it and fails the same way.
  • The same page requires both actions to be "fed with the credential description obtained from step (2) (which also contains the fields provided in step (1))" -- APM kept only username/password, so it could not honor that.

Approach (WHAT)

Outcome of the helper attempt Action
operation succeeded (classified ok) git credential approve (once per host/port/path per process)
credential_rejected and verified (status-anchored HTTP 401, or Git's 401 wording; never with a 403, not-found, or proxy signal, or an error naming another host) git credential reject (once), drop it from HelperCredentialCache -- unless this process already saw the same secret accepted on that host
403, sign-in redirect / 203 sign-in page, 404, 5xx, 429, timeout, TLS, DNS, off-origin redirect (raised or returned) nothing
ADO_APM_PAT, az bearer, gh token, GitHub/GitLab/generic fill nothing (not the chain helper step)

Implementation (HOW)

File Change
core/auth_outcome.py AuthOutcome.rejection_verified + is_verified_rejection. Only HTTP 401 (or Git's 401 wording, never with 403) for a presented credential sets it. The classifier stays the single decision owner.
core/token_manager.py GitHelperCredential.description keeps fill's attribute lines verbatim (repr/compare off). report_git_helper_credential runs `git credential approve
core/auth_chain.py report_helper_outcome is the only reporter, called once from run_ado_chain after the helper attempt. Process-wide HelperReportLedger enforces once per (host, port, path) and action; a credential with no fill description (not obtained from the helper) is never reported.
scripts/architecture_linter/checks/transport_auth_outcome.py Replaces "never approve/reject" with guard transport-platform-credential-report-owner: argv only in the runner, runner called only from report_helper_outcome, owner called only from the chain, reject gated on is_verified_rejection, 401-only verification in the classifier, once-per-key claim.
owner record, docs, skills host-credential-resolution decision/owner/guard updated; getting-started/authentication.md, apm-guide authentication.md, auth skill (+ .agents copy, lock hash) now describe the behavior.

Trade-offs

  • 401 only, not 403. 403 also answers a valid credential that lacks access to one repo; erasing it there would destroy a good credential. Git itself only rejects on 401.
  • Sign-in redirects/pages are not rejections. ADO answers both "no credential" and "bad credential" this way on REST; fail safe is to keep the credential.
  • ADO chain only. Only this chain classifies every attempt through the owner; GitHub/GitLab/generic fill sites escalate on any error, so reporting there could erase on a misclassification. Out of the accepted scope.
  • Replay fill's description verbatim (including password_expiry_utc / oauth_refresh_token if a helper returns them) instead of rebuilding it, per the contract.
  • Process-wide ledger rather than per-resolver, so several resolvers in one install never repeat a report. Keyed per (host, port, path) and action as scoped; not per credential fingerprint (a refreshed credential after a reject is approved only if approve was not already claimed -- GCM stores credentials it mints itself).
  • Accepted-secret check (no hashing, no extra secret copy: the resolver's helper cache is compared, constant-time, against keys already approved on that host): a 401 on another path for a secret that already worked on that host is "no access", not a dead credential, so it is never rejected.

Benefits

  1. A revoked/expired GCM credential is erased once, so the next fill can mint a fresh one instead of resending the dead one forever.
  2. Credentials that work are approved, so helpers that store on success (e.g. store, cache) keep them.
  3. Zero reports for ambiguous outcomes and non-helper credentials -- covered by 11 parametrized negative cases.
  4. A helper hang or crash on approve/reject never fails the command (tested with a 1s timeout and a raising runner).

Validation

Lint contract (CI mirror)
$ uvx [email protected] check src/ tests/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
All checks passed!
$ uvx [email protected] format --check ...
2356 files already formatted
$ bash scripts/lint-auth-signals.sh
[+] auth-signal lint clean
$ .venv/bin/python scripts/lint_architecture_boundaries.py --root .
(no output, exit 0)
$ .venv/bin/python -m pylint --disable=all --enable=R0801 --min-similarity-lines=10 --fail-on=R0801 src/apm_cli/ scripts/lint_architecture_boundaries.py scripts/architecture_linter/ scripts/windows_native_symlink_probe_entry.py
Your code has been rated at 10.00/10
Tests
$ .venv/bin/python -m pytest tests/unit/core/test_auth_credential_report.py -p no:xdist -q
36 passed
$ .venv/bin/python -m pytest tests/unit/core/ tests/unit/test_auth.py tests/unit/install/test_validation_ado_bearer.py tests/unit/marketplace/test_client_ado.py tests/unit/policy/test_discovery.py tests/unit/deps/test_download_strategies_phase3.py -p no:xdist -q
2064 passed, 5 subtests passed in 28.82s
$ .venv/bin/python -m pytest tests/integration/test_architecture_owner_rule_mutations.py -k report -p no:xdist -q
8 passed
$ .venv/bin/python -m pytest tests/integration/test_architecture_owner_rule_mutations.py tests/unit/scripts/test_architecture_runner.py -k "credential_report or coverage or sorted or surgical" -p no:xdist -q
198 passed
$ APM_E2E_TESTS=1 APM_BINARY_PATH=$PWD/.venv/bin/apm .venv/bin/python -m pytest tests/integration/test_ado_credential_helper_install_lifecycle.py -p no:xdist -q
10 passed in 43.97s
$ APM_E2E_TESTS=1 APM_BINARY_PATH=$PWD/.venv/bin/apm .venv/bin/python -m pytest tests/integration/test_ado_policy_signin_redirect_lifecycle.py tests/integration/test_ado_ref_resolution_fallback.py tests/integration/test_ado_adjacent_egress_lifecycle.py -p no:xdist -q
19 passed in 67.62s

Red before the fix: with src/ reverted, the new lifecycle scenario fails (1 failed) and the unit module cannot import report_helper_outcome.

Scenario evidence

User scenario Principle Test
GCM user installs from ADO; helper hears exactly one store with fill's host/path/username/password, GCM_INTERACTIVE=0 Secure by default test_ado_helper_credential_outcome_is_reported_back_to_git (real binary), test_accepted_helper_credential_is_approved_once_with_fill_description
Stored credential is revoked; next install fails and helper hears exactly one erase, no store Secure by default same lifecycle test; test_verified_rejection_rejects_once_and_drops_the_cache[http-401/git-401-prompt/git-authentication-failed]
403, sign-in page/redirect, 404, 5xx, 429, timeout, TLS, DNS, off-origin redirect: no report Fail closed on ambiguity test_ambiguous_helper_outcome_is_not_reported[*] (11 cases), test_returned_non_success_response_is_not_approved[*]
A 401 for another path never erases a secret that worked on that host; a 401 in a repo URL never verifies a rejection Secure by default test_secret_accepted_on_this_host_is_not_rejected_for_another_path, test_only_a_401_for_a_presented_credential_verifies_rejection[*]
Parallel workers, plain helpers without useHttpPath, ADO Server host:port Reliability / portability test_concurrent_workers_report_once_per_key, test_host_scoped_helper_without_use_http_path, test_ado_server_host_with_port_reports_port_in_host_field
ADO_APM_PAT, az bearer, GitHub fill: never reported Least privilege test_ado_pat_keeps_precedence_over_credential_helper (helper.events() == ()), test_accepted_env_pat_is_never_reported, test_rejected_pat_and_bearer_are_never_reported, test_accepted_bearer_is_never_reported, test_non_ado_helper_credential_is_never_reported
Report targets only the host/path derived from the dependency; mismatched or synthetic credentials are never reported Least privilege test_report_targets_only_the_derived_host, test_credential_for_another_host_is_never_reported, test_credential_not_obtained_from_fill_is_never_reported
Helper hangs or the report raises: install still succeeds Reliability test_hanging_helper_store_never_fails_the_operation, test_report_error_never_fails_the_operation
Only 401 verifies a rejection Classifier owns the decision test_only_a_401_for_a_presented_credential_verifies_rejection[*]

How to test

  • APM_E2E_TESTS=1 APM_BINARY_PATH=$PWD/.venv/bin/apm .venv/bin/python -m pytest tests/integration/test_ado_credential_helper_install_lifecycle.py -k reported_back -p no:xdist -q
  • .venv/bin/python -m pytest tests/unit/core/test_auth_credential_report.py -p no:xdist -q
  • Mutate elif outcome.is_verified_rejection: to elif outcome.is_auth_failure: in core/auth_chain.py and run .venv/bin/python scripts/lint_architecture_boundaries.py --root . -- guard transport-platform-credential-report-owner fails.

Issue and approved scope

Issue: Fixes #3765
Fixes #3752 (follow-up of the #3752 credential-helper fix; that issue is still open)

Human scope-approval comment: #3765 (comment)

Does this PR complete the issue, or what remains? It completes #3765's Done-when: approve on success, reject only on a classified (verified) credential rejection, no reports for env/gh/az or ambiguous/network/TLS/throttle/not-found/sign-in-redirect outcomes or underived hosts, helper failures never fail an install, hermetic tests for each case, and auth docs updated. Stacked on #3790 (base danielmeppiel-0361-t1-pr1-auth-owner); rebase onto main after v0.36.1 is tagged and #3790 lands.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour (commit carries an apm-spec-waiver line).

Co-authored-by: Copilot [email protected]

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

APM now reports helper credential results back to Git on the ADO chain: approve after a confirmed success, and reject once only after a verified 401. This lets credential managers replace dead credentials without APM wiping valid ones.

panel-mode=lean; personas=auth-expert,supply-chain-security-expert,test-coverage-expert,apm-ceo (supply-chain-security-expert ad hoc: captain kickoff requires the supply-chain lens on credential-store mutation)

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

This PR delivers the approve/reject half of the git-credential contract that 0.36.1 decision D3 deferred, while keeping the D3 rule that APM must never erase user credentials because of a misclassification. One owner (report_helper_outcome in auth_chain) makes the reports, replays the exact description fill returned, claims each report once per (host, port, path, action) per process, and never touches env, gh or az credentials. The architecture linter now enforces that ownership instead of banning approve/reject outright. Test-coverage found a regression trap for every Done-when clause of #3765, and the real-binary lifecycle tests passed. The only blocking finding was about how strictly a rejection is verified.

The panel reviewed head b8769c4. Folds since then (author-verified, not re-reviewed by the panel): (1) the blocking finding -- verified rejection now needs status-anchored 401 wording or one of Git's 401 phrases, and never fires with a 403 or not-found signal, with regression cases for a 401 inside a repository URL; (2) approve now requires the attempt to classify OK, so a returned non-2xx response is no longer treated as success (guarded by a linter literal); (3) reject is skipped when this process already saw the same secret accepted on that (host, port); (4) approve/reject timeout capped at 10s; (5) tests for concurrent workers, useHttpPath=false, and ADO Server host:port; (6) at 82b29e9, enterprise/security.md documents the reporting limits.

Two items were declined, and both declines are acceptable. A per-credential fingerprint in the ledger key would let rejects repeat within a process and could erase a series of refreshed credentials; the kickoff deliberately fixes one report per key, and the conservative choice is right on this surface. Discarding the cache on every 401 would re-run fill on every operation for a key already known to be stale.

Dissent. Auth-expert recommended keying the ledger per credential; the author declined, citing the fixed once-per-(host, port, path) limit and the reject-loop risk. The CEO sides with the decline: on a credential-erasing path the bounded rule is safer, and the finding was graded recommended.

Aligned with: Secure by default (reject needs verified 401 evidence and is skipped on ambiguity or after a same-host success; helper failures never fail an install). Governed by policy (transport-platform-credential-report-owner and its mutation tests keep approve/reject inside one owner). Multi-host (reports carry host:port and respect useHttpPath; GitHub/GitLab/generic fill paths deliberately do not report yet). Pragmatic as npm (matches what Git itself does with a credential helper).

Panel summary

Persona B R N Takeaway
Auth Expert 1 2 0 Chain correctly limits reports to helper credentials; a bare 401 text match could misclassify a not-found error (folded).
Supply Chain Security Expert 0 3 0 One owner, description replay, no non-helper credentials. Gaps: approve on returned non-2xx and per-path reject (folded).
Test Coverage Expert 0 3 0 Every Done-when clause has a trap; e2e approve/reject ran green. Gaps: useHttpPath=false, host:port, concurrency (folded).

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 3 follow-ups

  1. [Auth Expert] Run a delta review of the fold commits, focused on the 401 wording rules and the same-secret skip guard. -- These folds address the only blocking finding and add a guard on the erase path; they were checked by the author, not by the panel.
  2. [Auth Expert] Open an issue to decide whether the GitHub/GitLab/generic fill paths should report outcomes through the same owner. -- Today only the ADO chain reports; coverage should be extended or explicitly scoped out.
  3. [Test Coverage Expert] Extend the real-binary lifecycle scenario to cover a not-found error with 401 inside the URL and an approve-then-401 on another path for the same secret (no erase in both). -- The folds are proven at unit level; an end-to-end trap would catch a regression on this secure-by-default surface.

Recommendation

Ship once the owner PR #3790 lands, since this PR is stacked on it. The blocking finding and every convergent recommendation are folded, and the two declines are reasoned and conservative. Track the auth-expert delta pass on the 401 wording rules and the same-secret guard first.


Full per-persona findings

Auth Expert

  • [blocking] Verified-rejection text rule matched a bare 401 anywhere in Git output, including repository URLs, so a not-found error could be treated as a verified rejection. at src/apm_cli/core/auth_outcome.py
    Before this PR such a misclassification only escalated the chain; with reporting it would become destructive, contrary to D3.
    Suggested: Verify only from parsed statuses, status-anchored wording, or Git's 401 phrases; never with a 404/not-found signal; add regression cases. Folded.
  • [recommended] The once-per-process ledger is keyed on (host, port, path) and action, not on the credential. at src/apm_cli/core/auth_chain.py
    A refreshed credential after a reject may not be approved or rejected again in the same process.
    Suggested: Add a credential fingerprint to the claim key. Declined (kickoff fixes once per key; reject-loop risk).
  • [recommended] A returned (not raised) non-2xx response counted as success and triggered approve. at src/apm_cli/core/auth_chain.py
    Latent today (call sites raise), but unguarded.
    Suggested: Approve only on a classified OK outcome; add a returned-404 test. Folded.

Supply Chain Security Expert

  • [recommended] Approve on a returned non-2xx response. at src/apm_cli/core/auth_chain.py
    Does not match "approve if the credential allowed the operation". Folded.
    Proof (missing at): tests/unit/core/test_auth_credential_report.py::test_ambiguous_helper_outcome_is_not_reported -- proves: a returned non-success response does not cause Git to store the credential [secure-by-default]
  • [recommended] A 401 on a path the user cannot reach could erase a credential that works elsewhere on the host. at src/apm_cli/core/auth_chain.py
    APM acts on URLs from third-party manifests; if the same secret already worked on the host, the 401 means missing authorization.
    Suggested: Skip reject after an approve of the same secret on (host, port); document residual risk. Folded (code, test, and enterprise/security.md).
  • [recommended] Approve ran synchronously with the full fill timeout (default 60s). at src/apm_cli/core/token_manager.py
    Suggested: Give approve/reject a short timeout. Folded (10s cap).

Test Coverage Expert

  • [recommended] Default Git config without useHttpPath (host-wide helper scope) was not tested. Folded: test_host_scoped_helper_without_use_http_path.
    Proof (missing at): tests/unit/core/test_auth_credential_report.py [secure-by-default,vendor-neutral]
  • [recommended] No report test covered an Azure DevOps Server host with a port. Folded: test_ado_server_host_with_port_reports_port_in_host_field.
    Proof (missing at): tests/unit/core/test_auth_credential_report.py [secure-by-default,portability-by-manifest]
  • [recommended] Once-per-key was only tested sequentially. Folded: test_concurrent_workers_report_once_per_key.
    Proof (missing at): tests/unit/core/test_auth_credential_report.py [secure-by-default,devx]

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.


Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 17, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from 9ea61ff to 3c45a3b Compare November 17, 2026 22:08
Base automatically changed from danielmeppiel-0361-t1-pr1-auth-owner to main November 18, 2026 02:49
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from 3c45a3b to 640ddb1 Compare November 18, 2026 02:53
Comment thread src/apm_cli/core/auth_chain.py Fixed
Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:08
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from 8bfa005 to b66ada0 Compare November 18, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Credential handling can erase unrelated or valid secrets and expose secrets in verbose logs, while failed probes may be reported as successful.

10 open issues
What changed in this PR

This PR extends the Azure DevOps authentication chain from #3790 to report helper-sourced credential outcomes back to Git, addressing #3765 so expired credentials can be replaced.

Changes:

  • Preserve credential-fill descriptions for approval after success or rejection after a verified authentication failure.
  • Add process-wide report tracking, cache invalidation, and architecture ownership checks.
  • Expand regression coverage and update authentication documentation.
File Description
tests/​unit/​scripts/​test_architecture_runner.py Registers the credential-report ownership rule in the expected inventory.
tests/​unit/​core/​test_auth_outcome.py Tests verified rejection classification and retained fill descriptions.
tests/​unit/​core/​test_auth_credential_report.py Adds reporting, scoping, concurrency, and helper-failure coverage.
tests/​integration/​test_architecture_owner_rule_mutations.py Tests reporting ownership and rejection guardrails.
tests/​integration/​test_ado_credential_helper_install_lifecycle.py Adds installed-CLI approval and rejection scenarios.
src/​apm_cli/​core/​token_manager.py Retains fill descriptions and runs bounded Git credential reports.
src/​apm_cli/​core/​auth.py Reuses the shared helper-cache key function.
src/​apm_cli/​core/​auth_outcome.py Adds verified-rejection state and diagnostic checks.
src/​apm_cli/​core/​auth_chain.py Coordinates reporting, deduplication, and rejected-credential eviction.
scripts/​architecture_linter/​checks/​transport_auth_outcome.py Adds static checks for reporting ownership and safeguards.
packages/​apm-guide/​.apm/​skills/​apm-usage/​authentication.md Documents helper reporting for coding-agent guidance.
docs/​src/​content/​docs/​getting-started/​authentication.md Explains approval, rejection, and excluded outcomes.
docs/​src/​content/​docs/​enterprise/​security.md Documents reporting scope and security limits.
CHANGELOG.md Adds the user-facing credential-reporting entry.
apm.lock.yaml Updates hashes for the deployed auth skill.
.apm/​skills/​auth/​SKILL.md Updates canonical auth guidance with reporting ownership.
.apm/​architecture/​owners/​transport-auth-platform.json Records reporting ownership and its guard.
.agents/​skills/​auth/​SKILL.md Synchronizes deployed auth guidance.

Review effort: Balanced

Comment thread src/apm_cli/core/auth_chain.py Resolved
Comment thread src/apm_cli/core/auth_outcome.py Resolved
Comment thread src/apm_cli/core/auth_outcome.py Resolved
Comment thread src/apm_cli/core/auth_outcome.py Resolved
Comment thread src/apm_cli/core/token_manager.py Resolved
Comment thread src/apm_cli/core/token_manager.py Resolved
Comment thread src/apm_cli/core/auth_chain.py Resolved
Comment thread src/apm_cli/core/auth_chain.py Resolved
Comment thread src/apm_cli/core/auth_chain.py Resolved
Comment thread src/apm_cli/core/auth_outcome.py Resolved
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from bc20640 to b941fbd Compare November 18, 2026 03:47
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Folded in this run

  • (panel) Rejection verified only by status-anchored 401 wording or Git 401 phrases, never with a 403, not-found or proxy signal, or an error naming another endpoint -- resolved in 2563e89, 71fcda2.
  • (panel) Approve only on a classified OK outcome; 10s report timeout; security page documents the limits -- resolved in 2563e89, ac9eeba.
  • (copilot) CodeQL weak-hashing alert: no secret digest is computed any more -- resolved in 1110767.
  • (copilot) Ten review findings (process-wide atomic accepted-secret check, HTTP/x 403 veto, scheme and port endpoint match, sign-in URL never verified, description must match the sent credential, no helper stderr in logs, byte comparison, discard on every verified rejection, preflight timeout reported as an outcome, URLs excluded from text signals) -- resolved in b941fbd.

Deferred (out-of-scope follow-ups)

Regression-trap evidence (mutation-break gate)

Each new guard was removed and its test failed: accepted-secret skip, discard on every rejection, preflight timeout outcome, description username match, URL removal before text signals, plus the transport-platform-credential-report-owner MutationCase and four side-door mutations.

Lint contract

ruff check and format --check (0.15.12), pylint R0801, lint-auth-signals and the architecture linter are all silent at b941fbd.

CI

All required checks pass at b941fbd (23 pass, 0 fail), 0 open code-scanning alerts and 0 unresolved threads, after 2 CI fix iterations.


Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from b941fbd to 930bd1e Compare November 18, 2026 07:02
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 18, 2026
Follow the git-credential contract ("TYPICAL USE OF GIT CREDENTIAL",
https://git-scm.com/docs/git-credential): after the Azure DevOps chain
uses a credential from `git credential fill`, run `git credential approve`
when the operation succeeded and `git credential reject` after a verified
HTTP 401 for that credential, each fed the description fill returned.

- auth_outcome: AuthOutcome.rejection_verified / is_verified_rejection;
  only HTTP 401 (or Git's 401 wording) for a presented credential sets it.
  403, sign-in redirects and sign-in pages never do.
- token_manager: GitHelperCredential keeps fill's description verbatim;
  GitHubTokenManager.report_git_helper_credential runs approve/reject with
  the fill environment (GCM_INTERACTIVE=0 unattended), stdin only, timeout,
  debug-only failures, and only when the description matches the request.
- auth_chain: report_helper_outcome is the only reporter; once per
  (host, port, path) and action per process; reject drops the cached
  answer. Never for ADO_APM_PAT, az bearer, gh or non-ADO credentials.
- Guard transport-platform-credential-report-owner replaces the
  "never call approve/reject" check, with a MutationCase and side-door
  mutations.
- Hermetic tests with a real helper configured in an isolated global Git
  config, plus a real-binary install lifecycle scenario.

apm-spec-waiver: credential helper outcome reporting follows the git-credential contract and is outside the OpenAPM spec surface

Co-authored-by: Copilot App <[email protected]>
- Verify a rejection only from status-anchored 401 wording or Git's 401
  phrases, never when a 403 or not-found signal is present (a bare "401"
  can be part of a repository URL).
- Approve only when the helper attempt classified OK; a returned non-2xx
  response is no longer treated as acceptance.
- Never reject a secret this process already saw accepted on the same
  host (a 401 on another path means no access, not a dead credential).
- Cap approve/reject at a 10s timeout.
- Tests: concurrent workers, returned responses, cross-path 401,
  useHttpPath=false, Azure DevOps Server host:port, 401-in-URL cases.

apm-spec-waiver: credential helper outcome reporting follows the git-credential contract and is outside the OpenAPM spec surface

Co-authored-by: Copilot App <[email protected]>
Auth delta review folds:
- A proxy challenge (proxy wording or 407) or a URL naming a host other
  than the requested one makes a rejection ambiguous, so a proxy or
  off-host prompt can never erase the requested host's helper credential.
- The status-anchored 401/403 patterns require a separator, so a glued
  "http401" in a repository URL never counts.
- Tests for each case; security page lists the proxy and other-host cases.

apm-spec-waiver: credential helper outcome reporting follows the git-credential contract and is outside the OpenAPM spec surface

Co-authored-by: Copilot App <[email protected]>
CodeQL flagged the SHA-256 identity digest used to remember secrets that
were accepted on a host. Drop it: the report ledger now records only
approved (host, port, path) keys, and a verified rejection is skipped when
the resolver's helper cache already holds the same secret for an approved
key on that host (constant-time comparison). No secret is hashed or copied.

apm-spec-waiver: credential helper outcome reporting follows the git-credential contract and is outside the OpenAPM spec surface

Co-authored-by: Copilot App <[email protected]>
- Accepted-secret check is process-wide and atomic with the report claim
  (in-memory only, byte comparison, never hashed or logged).
- Every verified rejection drops the cached helper answer, even when the
  reject report was already sent.
- The fill description is reported only when its username, password and
  any path match the credential actually sent.
- Helper stderr is never logged.
- Classifier: versioned HTTP 403 status lines veto a rejection; another
  scheme or port is another endpoint; a response that landed on the ADO
  sign-in URL is never a verified rejection; repository URLs no longer
  trip the proxy and not-found checks; without a requested host any URL
  makes a rejection ambiguous.
- Install preflight: an ls-remote timeout reaches the auth chain as an
  outcome, not as a value it could approve.

apm-spec-waiver: credential helper outcome reporting follows the git-credential contract and is outside the OpenAPM spec surface

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the danielmeppiel-0370-credential-approve-reject branch from 930bd1e to a948e50 Compare November 18, 2026 07:07
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 0199ded into main Nov 18, 2026
30 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-0370-credential-approve-reject branch November 18, 2026 07:24
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 19, 2026
…idance (#3903)

* docs(changelog): enforce one-line entries in agent and contributor guidance

Make the changelog rule concrete in its single source
(.apm/instructions/changelog.instructions.md): one line, user-visible
effect first, 25 words or fewer, ending with (#PR); breaking changes in
"Breaking changes and upgrade notes" with a one-line migration; never a
second line for the same change; no entry for internal-only PRs; two
good and two bad examples from the current changelog.

cut-release now re-sanitizes the whole [Unreleased] block at release
time (dedupe, condense, Highlights, upgrade notes, ref/credit check).
The delivery and merge autopilot workers, pr-description-skill,
CONTRIBUTING.md, the PR template and the development guide point at
the rule. Generated .github/ and .agents/ copies and apm.lock.yaml
hashes are re-synced with apm install.

Clean the current [Unreleased] block into that shape: drop the long
duplicates of #3765/#3818, #3769, #3788, #3865, #3867, #3873, #3875,
#3882 and the spec lines, fold their user-relevant caveats into the
short lines, and drop test-only #3877.

Co-authored-by: Copilot App <[email protected]>

* docs(changelog): scope delivery-worker CHANGELOG edits to one task; shorten sanitizer example

Address review: only the task whose files_hint owns CHANGELOG.md edits it
(wave gate forbids shared-file edits across task branches), and the
worked example now fits rule 2 while keeping its caveat and four refs.

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: danielmeppiel <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants