types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

pkg/types/capabilities.go

pkg/types/entry.go

pkg/types/group.go

Index

Constants

View Source
const (
	CapabilityAll           = "tlog/*"
	CapabilityAdmin         = "tlog/admin"
	CapabilityAdminRevoke   = "tlog/admin/revoke"
	CapabilityAdminDelegate = "tlog/admin/delegate"
	CapabilityAppend        = "tlog/append"
	CapabilityRead          = "tlog/read"
)

Capability constants for UCAN authorization.

Variables

This section is empty.

Functions

func ResourceURI

func ResourceURI(logID string) string

ResourceURI creates a resource URI for a log.

Types

type GroupID

type GroupID string

GroupID is a unique identifier for a group.

type GroupMetadata

type GroupMetadata struct {
	ID              GroupID   `json:"id"`
	CreatorAccount  PublicKey `json:"creator_account"` // Deprecated: no longer used in simplified delegation model
	RecoveryKeyHash []byte    `json:"recovery_key_hash"`
	CreatedAt       time.Time `json:"created_at"`
	Frozen          bool      `json:"frozen"`
}

GroupMetadata contains persistent group configuration.

type GroupStatus

type GroupStatus struct {
	Metadata        GroupMetadata `json:"metadata"`
	EntriesLogIndex uint64        `json:"entries_log_index"`
	RevocationIndex uint64        `json:"revocation_index"`
}

GroupStatus represents the current state of a group.

type LogEntry

type LogEntry struct {
	Index     uint64    `json:"index"`
	Data      []byte    `json:"data"`
	Timestamp time.Time `json:"timestamp"`
	Submitter PublicKey `json:"submitter"`
}

LogEntry represents an entry in the primary tlog.

type LogEntryWithProof

type LogEntryWithProof struct {
	Entry          LogEntry `json:"entry"`
	InclusionProof []byte   `json:"inclusion_proof"`
	TreeSize       uint64   `json:"tree_size"`
	RootHash       []byte   `json:"root_hash"`
}

LogEntryWithProof includes the Merkle inclusion proof.

type PublicKey

type PublicKey []byte

PublicKey represents an ed25519 public key.

type RevocationEntry

type RevocationEntry struct {
	Index     uint64         `json:"index"`
	Type      RevocationType `json:"type"`
	Target    []byte         `json:"target"`
	Timestamp time.Time      `json:"timestamp"`
}

RevocationEntry represents an entry in the revocation tlog.

func (*RevocationEntry) Deserialize

func (e *RevocationEntry) Deserialize(data []byte) error

Deserialize populates a RevocationEntry from JSON bytes.

func (*RevocationEntry) Serialize

func (e *RevocationEntry) Serialize() ([]byte, error)

Serialize converts a RevocationEntry to JSON bytes for storage.

type RevocationType

type RevocationType string

RevocationType defines what is being revoked.

const (
	RevokeUCAN       RevocationType = "ucan"       // Revoke specific UCAN by hash
	RevokeAccount    RevocationType = "account"    // Revoke all UCANs for account
	RevokeCapability RevocationType = "capability" // Revoke specific capability
)

Jump to

Keyboard shortcuts

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