Skip to content

Add offline proofline preflight command and Azure/registry secret detectors - #95

Open
aurindo10 wants to merge 2 commits into
prooflinedev:mainfrom
aurindo10:feat/preflight-command-and-secret-detectors
Open

aurindo10 wants to merge 2 commits into
prooflinedev:mainfrom
aurindo10:feat/preflight-command-and-secret-detectors

Conversation

@aurindo10

@aurindo10 aurindo10 commented Nov 24, 2026 •

Copy link
Copy Markdown

Developers and coding agents could not run Proofline's local sensitive-file and secret preflight check without starting an authenticated review, and local secret detection did not yet cover the five credential families requested in #86.

This PR adds a local proofline preflight subcommand and expands secret detection across all five requested families:

  • Local proofline preflight command (src/lib.rs, src/git.rs, src/update.rs)
    • Dispatched before TLS CA setup, Origin::parse, and auth, and exempt from startup update checks when invoked as the top-level subcommand.
    • Supports --staged, --include-untracked, --path, --allow-path, --remote, and --json, reporting all sensitive .env paths and secret findings in a single pass without ever printing raw secret bytes (exit 0 when clean, 1 when blocked).
    • Blocks Git lazy fetches/transports (GIT_NO_LAZY_FETCH=1, GIT_ALLOW_PROTOCOL=""), isolates repository hooks via an empty core.hooksPath, and disables core.fsmonitor= on offline Git subprocesses. CLI help notes that working-tree mode stages into a scratch index (where user-configured Git clean filters may run) and that --staged inspects the existing index without staging.
  • Full-patch multi-finding scan + Local secret preflight doesn't recognise Azure storage keys, GitLab, npm, Hugging Face or PyPI tokens #86 credential detectors (src/preflight.rs)
    • Adds preflight::scan collecting every finding across files and multiple distinct credential families on a single line, while keeping preflight::check fail-fast on the first refusal for review --local and git hooks.
    • Adds detectors for Azure Storage account keys (case-insensitive AccountKey= followed by exact 86 base64 data bytes + == and non-base64 boundary), GitLab PATs (glpat-), npm tokens (npm_), Hugging Face tokens (hf_), and PyPI API tokens (pypi-AgEIcHlwaS5vcmc).

Closes #86

Proof: Reproduced the startup update-cache touch without PROOFLINE_NO_UPDATE_CHECK and verified the fix along with unit + offline end-to-end CLI tests (including partial-clone --filter=blob:none and hook isolation); cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, and cargo test --locked all passed on 1683041 (165 passed, 0 failed, 1 pre-existing ignored pre-commit test).

Created with Gemini 4 Neon in Antigravity.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:27:52.416941Z 1683041 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 549e7a18c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib.rs Outdated
completions(*shell, &mut std::io::stdout().lock())?;
return Ok(Verdict::Done);
}
Command::Preflight(args) => return run_preflight(args).await,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exempt preflight from the startup update check

With update checks enabled and a missing or day-old update cache, proofline preflight still initiates outbound HTTPS traffic despite its description promising to inspect credentials “offline.” src/main.rs:14 calls update::on_invocation() before this early return; the exclusions in src/update.rs:90-95 omit preflight, so the spawned __update-check requests https://proofline.sh/cli/latest (src/update.rs:274-278). Exempt this command from the startup update check as well. The new integration tests set PROOFLINE_NO_UPDATE_CHECK=1, masking this behavior rather than verifying that a normal invocation stays offline.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Note

🤖 Gemini 4 Neon responding on behalf of aurindo10

Fixed in 1683041. update::on_invocation() now exempts preflight only when invoked as the top-level subcommand (skipping recognized global options without matching argument values like review --path preflight), and tests/preflight.rs runs with PROOFLINE_NO_UPDATE_CHECK unset against an isolated cache directory to assert the update cache is never created.

@aurindo10
aurindo10 force-pushed the feat/preflight-command-and-secret-detectors branch from 549e7a1 to 1683041 Compare November 24, 2026 14:24
@aurindo10

Copy link
Copy Markdown
Author

Note

🤖 Gemini 4 Neon responding on behalf of aurindo10

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 1683041075

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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.

Local secret preflight doesn't recognise Azure storage keys, GitLab, npm, Hugging Face or PyPI tokens

1 participant