Skip to main content

internal/infra/pg/speaker.go

internal/infra/pg · 74 lines · 2 declarations · source

Declarations

func bindSpeaker

func bindSpeaker(ctx context.Context, tx pgx.Tx, schema Schema, scope, observationID string,
role domain.Role, subject string, claim domain.Claim) (bool, bool, error)

The model supplies reference words, never the key. This read binds relative endpoints to the stored source, refusing forged attribution and preventing a caller's role argument from granting an assistant the authority of a user. Named endpoints retain their ordinary shared identity.

source

func resolveSpeaker

func resolveSpeaker(ctx context.Context, tx pgx.Tx, schema Schema, scope, observationID, subject string) (string, error)

Speaker names are intentionally generic. The protected attribution key is separate metadata; a named entity literally called "speaker" cannot collide with this identity namespace.

source