All checks were successful
Check / check (push) Successful in 1m16s
Changes the Go module path from `git.eeqj.de/sneak/upaas` to `sneak.berlin/go/upaas`. All import paths in Go files updated accordingly. `go mod tidy` and `make check` pass cleanly. fixes #143 Co-authored-by: user <user@Mac.lan guest wan> Co-authored-by: Jeffrey Paul <sneak@noreply.example.org> Reviewed-on: #149 Co-authored-by: clawbot <clawbot@noreply.example.org> Co-committed-by: clawbot <clawbot@noreply.example.org>
29 lines
648 B
Go
29 lines
648 B
Go
package database_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"sneak.berlin/go/upaas/internal/database"
|
|
)
|
|
|
|
func TestHashWebhookSecret(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// Known SHA-256 of "test-secret"
|
|
hash := database.HashWebhookSecret("test-secret")
|
|
assert.Equal(t,
|
|
"9caf06bb4436cdbfa20af9121a626bc1093c4f54b31c0fa937957856135345b6",
|
|
hash,
|
|
)
|
|
|
|
// Different secrets produce different hashes
|
|
hash2 := database.HashWebhookSecret("other-secret")
|
|
assert.NotEqual(t, hash, hash2)
|
|
|
|
// Same secret always produces same hash (deterministic)
|
|
hash3 := database.HashWebhookSecret("test-secret")
|
|
assert.Equal(t, hash, hash3)
|
|
}
|