Skip to content

refactor(a2a,index): pre-hash auth token at startup; add NodeKind and Lang newtypes#4438

Merged
bug-ops merged 3 commits into
mainfrom
issue-4389-a2a-auth-prehash-index-newtypes
May 18, 2026
Merged

refactor(a2a,index): pre-hash auth token at startup; add NodeKind and Lang newtypes#4438
bug-ops merged 3 commits into
mainfrom
issue-4389-a2a-auth-prehash-index-newtypes

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 18, 2026

Summary

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • cargo nextest run -p zeph-a2a -p zeph-index --lib — 204/204 pass

Closes #4389
Closes #4390

@github-actions github-actions Bot added refactor Code refactoring without functional changes size/M Medium PR (51-200 lines) rust Rust code changes and removed size/M Medium PR (51-200 lines) labels May 18, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 18, 2026 21:17
@bug-ops bug-ops force-pushed the issue-4389-a2a-auth-prehash-index-newtypes branch from d6cc81c to 7a9f449 Compare May 18, 2026 21:17
@github-actions github-actions Bot added the size/M Medium PR (51-200 lines) label May 18, 2026
@bug-ops bug-ops force-pushed the issue-4389-a2a-auth-prehash-index-newtypes branch from 7a9f449 to 029f6c3 Compare May 18, 2026 21:19
bug-ops added 2 commits May 18, 2026 23:29
… Lang newtypes

Closes #4389, Closes #4390

zeph-a2a: AuthConfig now stores token_hash: Option<blake3::Hash> computed
once at construction via AuthConfig::new(). auth_middleware compares
hashes with subtle::ConstantTimeEq instead of re-hashing on every
request. Raw token string is not retained in memory after startup.

zeph-index: Add NodeKind(pub String) newtype for tree-sitter node kinds
with Display, AsRef<str>, From<String>, From<&str>. Add Lang::from_id
to parse language from stored &str. SearchHit::node_type is now NodeKind
and SearchHit::language is now Lang, making invalid states unrepresentable.
@bug-ops bug-ops force-pushed the issue-4389-a2a-auth-prehash-index-newtypes branch from 11071b8 to e10dbb1 Compare May 18, 2026 21:29
@bug-ops bug-ops merged commit ea207d5 into main May 18, 2026
32 checks passed
@bug-ops bug-ops deleted the issue-4389-a2a-auth-prehash-index-newtypes branch May 18, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring without functional changes rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index: node_type and language stored as plain String — missing newtype a2a: AuthConfig stores raw token string instead of pre-hashed digest

1 participant