nativeAttachmentStore mints capability tokens with the deployment HMAC secret (HMAC-SHA256, the same crypto family as the HITL magic-link) and points URLs at e2a's own /…/attachments/{index}/download route. Zero external dependency. The token is purpose-scoped: it binds message_id + index + expiry,
| 50 | // token is purpose-scoped: it binds message_id + index + expiry, so it can only |
| 51 | // download the exact attachment it was minted for and only until it expires. |
| 52 | type nativeAttachmentStore struct { |
| 53 | secret []byte |
| 54 | publicURL string // base, e.g. https://api.e2a.dev (no trailing slash) |
| 55 | } |
| 56 | |
| 57 | // NewNativeAttachmentStore returns the default (zero-dependency) attachment store. |
| 58 | func NewNativeAttachmentStore(secret, publicURL string) AttachmentStore { |
nothing calls this directly
no outgoing calls
no test coverage detected