Files
archie/internal/infrastructure/edastore/testsupport_test.go
T
sam 684ec1263a feat(eda): sources own signing, with UUIDv7 paths and approved unsigned option
A source is the capture endpoint: a UUIDv7 path by default or a unique
URL-safe custom path, signed by default with an Archie-generated secret
(encrypted via the bindings cipher), or unsigned after an approval.
Intake verifies X-Hub-Signature-256/X-Signature-256 against the source
secret before redaction; an unauthenticated event on a signed source is
captured but never dispatched, an event on an approved unsigned source
dispatches and is marked unsigned. The binding secret is retired; migration
0006 derives sources from existing binding and capture source strings,
moving each binding's secret onto its source. SourceStore crosses the
State Store gRPC contract. The dashboard gains a sources panel and flags
unsigned in the capture inspector, binding list and task timeline.
2026-09-24 14:26:21 +10:00

29 lines
652 B
Go

package edastore
import (
"testing"
"github.com/samcharles93/archie-core/internal/domain/binding"
)
// bindingInput is the small shape the cipher tests need, kept separate from
// binding.Binding so a domain field addition does not churn every test.
type bindingInput struct {
Name string
Source string
Workflow string
}
func insertBinding(t *testing.T, s *Store, in bindingInput) string {
t.Helper()
id, err := s.InsertBinding(t.Context(), binding.Binding{
Name: in.Name,
Matcher: binding.Matcher{Source: in.Source},
Workflow: in.Workflow,
})
if err != nil {
t.Fatalf("InsertBinding() error = %v", err)
}
return id
}