Documentation
¶
Overview ¶
Package postgres persists agentidentity service grants in a host-owned SQL schema. It never provisions a database, schema, issuer key or human identity.
Index ¶
- type Store
- func (s *Store) ConsumeAssertion(ctx context.Context, use agentidentity.AssertionUse) (bool, error)
- func (s *Store) CreateGrant(ctx context.Context, g agentidentity.Grant) error
- func (s *Store) GetGrant(ctx context.Context, id string) (agentidentity.Grant, error)
- func (s *Store) IsTokenRevoked(ctx context.Context, jtiHash string) (bool, error)
- func (s *Store) ListGrants(ctx context.Context, owner agentidentity.Owner) ([]agentidentity.Grant, error)
- func (s *Store) Record(ctx context.Context, e agentidentity.Audit) error
- func (s *Store) RevokeGrant(ctx context.Context, id string, expectedVersion int64, actor string, ...) error
- func (s *Store) RevokeToken(ctx context.Context, jtiHash, actor string, at, expiresAt time.Time) 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
}
Store uses one shared schema for ALL tenant grants and replay identities. The caller owns connection security/pool lifecycle, migration and current human/tenant authorization. Schema is copied/validated; no search_path is used.
func (*Store) ConsumeAssertion ¶
func (s *Store) ConsumeAssertion(ctx context.Context, use agentidentity.AssertionUse) (bool, error)
ConsumeAssertion serializes with grant revoke and atomically rechecks the current row. The DB clock also refuses expired state if a caller clock lags. One bound JTIHash is consumed globally, never by grant/version partition.
func (*Store) CreateGrant ¶
func (*Store) IsTokenRevoked ¶
func (*Store) ListGrants ¶
func (s *Store) ListGrants(ctx context.Context, owner agentidentity.Owner) ([]agentidentity.Grant, error)
ListGrants is internal persistence, not an owner-authorized endpoint. The reusable management handler filters each row using CURRENT OwnerPolicy. Original ApprovedBy must not be used to infer today's tenant authority.
func (*Store) Record ¶
Record retains fixed-code service/management metadata. Create/Revoke also append their distinct committed event in the SAME mutation transaction.