Documentation
¶
Overview ¶
Package postgres provides a PostgreSQL-backed implementation of delegation.Store. Encoded delegation payloads are stored directly in the delegation table's data column.
Index ¶
- type Store
- func (s *Store) DeleteByAudience(ctx context.Context, audience did.DID) error
- func (s *Store) DeleteBySubject(ctx context.Context, subject did.DID) error
- func (s *Store) Initialize(ctx context.Context) error
- func (s *Store) ListByAudience(ctx context.Context, audience did.DID, opts ...store.PaginationOption) (store.Page[ucan.Delegation], error)
- func (s *Store) ProofChain(ctx context.Context, aud did.DID, cmd ucan.Command, sub did.DID) ([]ucan.Delegation, []cid.Cid, error)
- func (s *Store) PutBatch(ctx context.Context, delegations []ucan.Delegation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteByAudience ¶
func (*Store) DeleteBySubject ¶
func (*Store) Initialize ¶
Initialize is a no-op. Schema is managed by the shared goose migrations.
func (*Store) ListByAudience ¶
func (*Store) ProofChain ¶
func (s *Store) ProofChain(ctx context.Context, aud did.DID, cmd ucan.Command, sub did.DID) ([]ucan.Delegation, []cid.Cid, error)
ProofChain builds the proof chain from aud toward sub for cmd in a single recursive query. The walk follows edges audience -> issuer, matching the fixed subject (or NULL powerline delegations) and requiring each delegation's command to prove the child's command (the segment-boundary prefix test from command.Command.Proves). A delegation whose subject equals its issuer is the trust root and terminates a path. The shortest complete path is returned root-first, mirroring the in-memory store's use of libforge's ProofChain.