Repository navigation
feat(insurance): add default-off Archera settings, lazy client and status endpoint - #795
Merged
Merged
Conversation
…atus endpoint Adds internal/archera (ARCHERA_ORG_ID, ARCHERA_PLAN_ID, ARCHERA_API_KEY_SECRET; key resolved lazily through the secret resolver, mutex-guarded so a failed resolve is retried) and GET /api/insurance/status, gated on view:recommendations plus an unrestricted account scope (scoped sessions get 404). Status reports setting presence by name only and makes no outbound call. The comparison endpoint follows in a separate PR. Refs #785 #786 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Member
Author
|
Gate review at cd16c3d: BLOCKED by CI (gosec), and the branch is behind main by 7d492ec. The code review itself is clean. Blocker:
Verified independently (git archive, go1.26.9):
|
Member
Author
|
Gate re-run at 0c2cb2e: CLEAN, merging.
|
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR2a of #785. Security-sensitive: handles an API key and gates on authz.
Redaction hazard found here (relevant to every pkg/insurance consumer): a struct holding a plain *insurance.Client in an UNEXPORTED field, printed with fmt %s (also on any struct containing it), prints the client fields including the API key, because fmt does not call Client.Format on unexported fields and dereferences the pointer for that verb. Reproducer: type P struct{ client *insurance.Client }; fmt.Sprintf("%s", P{c}). %v/%+v/%#v did not leak in my run. Fix here: the client is held in an atomic.Pointer (fmt prints an address) and *Provider has a Format method. Tests print the Provider, a wrapping struct, Settings and the Handler with %v %+v %#v %s before and after the client is built and after a successful synthetic comparison, grepping for the synthetic key.
Verification (local macOS, synthetic key and IDs, no live api.archera.ai calls; RoundTripper asserts host api.archera.ai): go build, go vet, golangci-lint (0 issues), go test ./internal/... and go test -tags integration for internal/api, internal/server, internal/purchase all exit 0. Mock/httptest evidence only; no deploy.
Refs #785 #786
🤖 Generated with Claude Code
Summary by CodeRabbit