·
Last changedVersion:
This version passed the hardening gate. Hardening applied 6 targeted changes and preserved all other text. Classified findings before hardening: 0. Classified findings closed: 0. Classified findings remaining: 0. Unclassified scanner findings remaining: 0. Review findings closed: 10. Review findings remaining: 1.
None
None
Expand | File | Group | Subtype | Severity | Status |
|---|
No findings available
0 findings
Pub/Sub is for asynchronous messaging between services. Producers publish events to a Topic; consumers attach Subscriptions to react. Resources must be declared at package level — never inside functions.
This handler is a minimal sketch. In real code, treat the event fields as untrusted input: check that the referenced order exists and belongs to the user, look up the email address from your own records, and make the handler idempotent by recording that this order was already handled by this subscription, so a repeated delivery still sends only one email.
Use Attribute<T> for fields that should be treated as message attributes (for filtering/ordering):
Pass topic access to other code while maintaining static analysis:
The user and total values above are placeholders. In real code, pass them in, taking the user from the authenticated caller or the order record.
at-least-once (the usual choice; always set the delivery guarantee explicitly in the topic config): may deliver duplicates → handlers must be idempotent.exactly-once: stricter, capped throughput (AWS 300 msg/s/topic, GCP 3000+ msg/s/region). Does not deduplicate on the publish side.Attribute<T> for fields meant for filtering/ordering, not for arbitrary metadata. Attribute values are visible to the broker, so use opaque identifiers there that reveal nothing sensitive.publish returns once the message is queued, so put slow or heavy work in subscription handlers rather than in the code that publishes.Get started with chainctlchainctl skill install public/encoredev/pubsub:latest
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/encoredev/encore/pubsub:latest
Apache-2.0
HARDENING.md
LICENSE
SKILL.md