fix: preserve credential helpers for generic marketplace git - #2594
fix: preserve credential helpers for generic marketplace git#2594Aryan Singh K. (aryansk) wants to merge 3 commits into
Conversation
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Remote-aware policy remains centralized. |
| CLI Logging Expert | 0 | 0 | 0 | Credential-bearing exception text was removed. |
| DevX UX Expert | 0 | 1 | 0 | Add-specific retry guidance is a separate concern. |
| Supply Chain Security Expert | 0 | 0 | 0 | Generic Git diagnostics no longer render helper output. |
| OSS Growth Hacker | 0 | 0 | 0 | Native helper support is clear and accurately documented. |
| Auth Expert | 0 | 0 | 0 | Provider and transport policy meet the auth boundary. |
| Doc Writer | 0 | 0 | 0 | Transport docs and reference wording match implementation. |
| Test Coverage Expert | 0 | 1 | 0 | CI must execute the installed-candidate lifecycle. |
| Performance Expert | 0 | 0 | 0 | GitCache and sparse checkout behavior remain unchanged. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 2 follow-ups
- [Test Coverage Expert] Require CI to run the installed-candidate generic HTTPS credential-helper lifecycle test. -- Local validation could not run it because the available binary is stale and uv failed to download build dependencies with socket error 57.
- [DevX UX Expert] Track an add-specific retry hint as a separate follow-up. -- Adding operation context through all fetchers and error paths is broader than this auth-policy change and predates it.
Architecture
classDiagram
direction LR
class MarketplaceClientModule {
+_fetch_git(source, file_path, host_info, auth_resolver)
}
class AuthResolver {
+resolve_for_remote(host, remote_url, org) AuthContext
+git_env_for_remote(ctx, remote_url) dict
}
class GitTransportPolicy {
+use_resolved_credentials bool
+allow_native_credential_lookup bool
}
MarketplaceClientModule ..> AuthResolver : delegates
AuthResolver ..> GitTransportPolicy : applies
flowchart TD
A[marketplace add/list] --> B[_fetch_git]
B --> C[AuthResolver]
C --> D[git_transport_policy]
D --> E{remote and host kind}
E -->|generic HTTPS| F[native Git helper]
E -->|generic HTTP| G[isolated configuration]
E -->|generic SSH| H[token-free SSH]
E -->|recognized host| I[hardened environment]
F --> J[GitCache]
G --> J
H --> J
I --> J
Recommendation
Proceed with constraints. Merge after CI executes the installed-candidate lifecycle test; retain the add-specific retry hint as a scoped follow-up rather than expanding this auth-policy PR.
Full per-persona findings
Python Architect
- [nit] Keep future marketplace Git transports routed through the provider registry policy at
src/apm_cli/core/host_providers.py:171.
CLI Logging Expert
No findings after the credential-safe error fix.
DevX UX Expert
- [recommended] Track an add-specific retry hint separately. This predates the auth-policy change and requires operation context through all fetchers and errors.
Supply Chain Security Expert
No findings after the credential-safe error fix.
OSS Growth Hacker
No findings after native helper lookup was delegated to Git and docs were corrected.
Auth Expert
No findings.
Doc Writer
No findings after documentation corrections and the reference update.
Test Coverage Expert
- [recommended] Run
test_generic_https_marketplace_add_uses_native_credential_helperagainst the installed candidate in CI. Local package build dependencies cannot be downloaded.
Performance Expert
No findings.
This panel is advisory. It does not block merge. Re-apply the panel-review label after addressing feedback to re-run.
Centralize marketplace Git transport policy in AuthResolver so generic HTTPS uses native helpers without platform credentials, while HTTP and SSH remain noninteractive and token-free. Add policy, authority, lifecycle, and documentation coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4fbfb24 to
1fac469
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1fac469 to
3417864
Compare
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Python Architect | 0 | 0 | 1 | Marketplace delegates remote policy to AuthResolver and host providers. |
| CLI Logging Expert | 0 | 0 | 0 | Fetch failures retain an actionable retry path without exposing details. |
| DevX UX Expert | 0 | 2 | 0 | Transport-specific recovery guidance would improve failures. |
| Supply Chain Security Expert | 0 | 0 | 0 | Initial findings were folded before this final recommendation. |
| OSS Growth Hacker | 0 | 0 | 0 | Documentation communicates the security improvement clearly. |
| Auth Expert | 0 | 0 | 0 | Provider credentials are now confined to HTTPS. |
| Doc Writer | 0 | 1 | 1 | A short cross-reference would improve discoverability. |
| Test Coverage Expert | 0 | 1 | 0 | Lifecycle and policy coverage passed; add reviewer-facing scenario mapping. |
| Performance Expert | 0 | 0 | 0 | One local config probe is negligible beside Git network work. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 3 follow-ups
- [DevX UX Expert] Make marketplace transport failures identify the attempted transport rather than using generic credentials-or-SSH-key wording -- transport-specific guidance shortens recovery time.
- [Doc Writer] Add the authentication cross-reference when its documentation patch can be cleanly applied -- it improves discoverability.
- [Test Coverage Expert] Add a PR Scenario Evidence table -- the exercised HTTPS and SSH policy matrix becomes easier to audit.
Recommendation
Ship the security-hardened transport policy. Track the three recommended clarity and reviewability improvements separately; none outweigh the passed policy and lifecycle evidence for the corrected behavior.
Full per-persona findings
The panel's initial blocking auth and supply-chain findings were folded: known-provider SSH is token-free, HTTP replaces caller global config with the isolated config, and HTTPS rewrite checking examines the final Git environment and fails closed. Remaining findings are the three recommended follow-ups above; CLI logging, growth, Python architecture, and performance reported no required change.
This panel is advisory. Re-apply the panel-review label after addressing feedback to re-run.
| raise ValueError("TLS requires both certfile and keyfile") | ||
| context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) | ||
| context.load_cert_chain(certfile=certfile, keyfile=keyfile) | ||
| server.socket = context.wrap_socket(server.socket, server_side=True) |
Summary
Preserve the resolver's normal Git environment for generic marketplace hosts so configured credential helpers such as macOS Keychain or libsecret remain available. Known platform paths such as Azure DevOps keep using the hardened Git environment.
Testing
Fixes #2526