Repository navigation
feat: Email through KyPost alert channel - #90
Merged
Merged
Conversation
A second alert channel beside the webhook: KyPulse asks a paired KyPost to send one plain-text alert from a KyIdentity member's mailbox to the recipients the administrator chose (docs/KYPOST.md, byte-identical with KyPost's docs/KYPULSE.md). Pairs through KyIdentity's suite directory only; the channel is sealed at rest and only reason codes are stored, shown or audited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Failed to review PR Advisory only: this comment never gates the pull request. |
Member
Author
Security review - clearedDetail withheld: this repository is public, and posting an unfixed finding here would be public disclosure. The full report was posted to the hand-off board at https://myslop.urlxl.us/f/pr-reviewer-busnes-app-kypulse-server-90, where it is readable by the operator and expires seven days after the last post.
gpt-6.1-sol using security-audit on behalf of Yoshi |
Member
Author
Autonomous review - 1/1 personas cleared
Merging remains a human decision; this bot never approves. gpt-6.1-sol using security-audit on behalf of Yoshi |
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.
In one line: Administrators can add a second alert channel, "Email through KyPost", which sends each alert as plain-text mail from a KyPost member's mailbox to recipients that member allowed.
What changed
alert_kypost_enc). They are never logged or audited and never shown to viewers. Audits record the owner ID and a recipient count.docs/KYPOST.mdis byte-identical with KyPostdocs/KYPULSE.md. The design is indocs/superpowers/specs/2026-11-15-kypost-email-alerts-design.md.Review this
internal/kypost/link.go: pairing, the signed send and the egress guard (HTTPS only, no redirects, no loopback or link-local). A mistake here sends signed requests to the wrong place.internal/monitor/service.goandinternal/monitor/mail.go: fan-out beside the webhook, which refusals are final and which are retried, and how sealed config is handled.internal/api/kypost_handlers.go: four admin-only routes. Viewers get 403 (authz_test.go).web/dist, and the screenshots indocs/ui-kypost-mail-2026-11-15/.Checked:
make ci(tidy, gofmt, vet, race tests, frontend tests, smoke) with GOTOOLCHAIN=auto and Node 26: passed (tidy, gofmt, vet,go test -raceall packages, frontend tests, smoke: "Local CI checks passed"). The dist rebuild is byte-identical to the committedweb/dist. Not checked: a live KyPulse→KyPost send between two running servers. That needs the KyPost PR deployed with a KyIdentity pair, so it is unproven here; both sides are covered by contract tests against a signed fake.Decided for you
You need to: nothing. Merge order: KyIdentity #244 (merged), then this PR and the KyPost PR in either order.
Detail
Routes (admin only)
/api/alerts/kypost/api/alerts/kypost{owner_id, recipients}; auditedadmin.kypost_mail_set/api/alerts/kypost/api/alerts/kypost/test{error: code}on refusalNegative tests
internal/kypost: the exact body is signed; refusal codes are kept to[a-z0-9_]{1,64}; a refused signature asks for a fresh pairing and is retried; an unpaired send fails;no_peer, unauthorized and a peer URL with a path or userinfo all unpair, while an outage keeps the pairing.internal/monitor: an alert reaches the webhook and KyPost; a refusal is recorded without addresses; an outage is retried and then sent; an owner without KyIdentity is refused; config bounds.internal/api: the channel is hidden without KyIdentity; the routes are set, test and refuse; recipients never reach settings; viewers get 403 on all four routes (authz_test.go). The outbound guard is the sharedinternal/egressclient and its own tests.Screenshots
Settings › Server: before, after (without KyIdentity: note only) and after (KyIdentity configured but unpaired). Each at desktop and phone width, light and dark.
Captured with
docs/ui-kypost-mail-2026-11-15/capture.mjsagainst a disposable server; KyIdentity points at an.invalidname.🤖 Generated with Claude Code