feat(mail): add Resend API transport

This commit is contained in:
shira committed 2026-10-06 02:38:17 +03:00
1 parent 1aa7a9feaf
commit c85b642d32
13 files changed
+1387 -63

No files matched your search

@@ -0,0 +1,21 @@
package resend
import (
"bytes"
"fmt"
"log/slog"
"strings"
"testing"
)
func TestCredentialRedactsItself(t *testing.T) {
const key = "re_credential-test-key"
value := credential{authorization: "Bearer " + key}
var logs bytes.Buffer
slog.New(slog.NewTextHandler(&logs, nil)).Info("credential", slog.Any("value", value), slog.Any("pointer", &value))
output := fmt.Sprintf("%v %+v %#v %s %q", value, value, value, value, value) + fmt.Sprint(&value) + logs.String()
if strings.Contains(output, key) {
t.Fatalf("printed credential exposes the API key: %s", output)
}
}