postgres

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0, MIT Imports: 13 Imported by: 0

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

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 New

func New(pool *pgxpool.Pool) *Store

func (*Store) DeleteByAudience

func (s *Store) DeleteByAudience(ctx context.Context, audience did.DID) error

func (*Store) DeleteBySubject

func (s *Store) DeleteBySubject(ctx context.Context, subject did.DID) error

func (*Store) Initialize

func (s *Store) Initialize(ctx context.Context) error

Initialize is a no-op. Schema is managed by the shared goose migrations.

func (*Store) ListByAudience

func (s *Store) ListByAudience(ctx context.Context, audience did.DID, opts ...store.PaginationOption) (store.Page[ucan.Delegation], error)

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.

func (*Store) PutBatch

func (s *Store) PutBatch(ctx context.Context, delegations []ucan.Delegation) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL