servicepolicy

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLiveServiceDisabled = errors.New("live Signal service transport disabled")

ErrLiveServiceDisabled is returned by code paths that hard-disable live mode or would create/use a live official Signal service transport without a complete approval package.

Functions

func RequiredLiveApprovals added in v0.3.0

func RequiredLiveApprovals() []string

Types

type AbusePolicy added in v0.4.0

type AbusePolicy struct {
	IdempotencyRequired   bool
	RateLimitRef          string
	RecipientAllowlistRef string
	DeclaredAudienceRef   string
	ChallengePolicyRef    string
	BackoffPolicyRef      string
}

type AccountConsent added in v0.4.0

type AccountConsent struct {
	AccountRef  string
	EvidenceRef string
	ExpiresAt   time.Time
}

type Action added in v0.2.0

type Action string
const (
	ActionRegister         Action = "register"
	ActionLogin            Action = "login"
	ActionLinkedDevice     Action = "linked_device"
	ActionSend             Action = "send"
	ActionReceive          Action = "receive"
	ActionBackupUpload     Action = "backup_upload"
	ActionBackupDownload   Action = "backup_download"
	ActionUsernameReserve  Action = "username_reserve"
	ActionProductionEgress Action = "production_egress"
)

type ApprovalPackage added in v0.4.0

type ApprovalPackage struct {
	OperatorApproval     OperatorApproval
	ServiceAuthorization ServiceAuthorization
	AccountConsent       AccountConsent
	CustodyPolicy        CustodyPolicy
	AbusePolicy          AbusePolicy
	EgressPolicy         EgressPolicy
	AuditPolicy          AuditPolicy
}

type ApprovalValidationReport added in v0.4.0

type ApprovalValidationReport struct {
	LiveAllowed   bool
	DeniedReasons []string
}

func ValidateApprovalPackage added in v0.4.0

func ValidateApprovalPackage(pkg ApprovalPackage, now time.Time, requested []Action) ApprovalValidationReport

type AuditPolicy added in v0.4.0

type AuditPolicy struct {
	AuditRef     string
	RetentionRef string
	RedactionRef string
}

type ComplianceReport added in v0.2.0

type ComplianceReport struct {
	Mode                Mode
	Approved            bool
	LiveServiceDisabled bool
	BlockedActions      []Action
	RequiredApprovals   []string
	DeferredDomains     []string
}

func EvaluateCompliance added in v0.2.0

func EvaluateCompliance(req ComplianceRequest) ComplianceReport

type ComplianceRequest added in v0.2.0

type ComplianceRequest struct {
	Mode             Mode
	RequestedActions []Action
}

type CustodyPolicy added in v0.4.0

type CustodyPolicy struct {
	Backend      string
	KeyHandleRef string
	BackupRef    string
	RotationRef  string
}

type EgressPolicy added in v0.4.0

type EgressPolicy struct {
	EndpointAllowlist []string
	TLSPolicyRef      string
	DryRun            bool
}

type LiveApprovalSet added in v0.3.0

type LiveApprovalSet map[string]bool

func NewLiveApprovalSet added in v0.3.0

func NewLiveApprovalSet(approvals ...string) LiveApprovalSet

type Mode

type Mode string
const (
	ModeDisabled   Mode = "disabled"
	ModeTestDouble Mode = "test_double"
	ModeLive       Mode = "live"
)

type OperatorApproval added in v0.4.0

type OperatorApproval struct {
	ID        string
	Scope     string
	GrantedAt time.Time
	ExpiresAt time.Time
}

type Policy

type Policy struct {
	Mode Mode
}

func (Policy) AllowsApprovedLiveTransport added in v0.4.0

func (p Policy) AllowsApprovedLiveTransport(pkg ApprovalPackage, now time.Time, requested ...Action) bool

func (Policy) AllowsLiveTransport

func (p Policy) AllowsLiveTransport(approval ApprovalPackage, now time.Time, requested ...Action) bool

AllowsLiveTransport reports whether policy metadata contains the machine-checkable approvals a future live transport would require. This package still ships no live transport implementation, and Validate continues to reject ModeLive.

func (Policy) Validate

func (p Policy) Validate() error

type ServiceAuthorization added in v0.4.0

type ServiceAuthorization struct {
	Type        ServiceAuthorizationType
	EvidenceRef string
	ExpiresAt   time.Time
}

type ServiceAuthorizationType added in v0.4.0

type ServiceAuthorizationType string
const (
	ServiceAuthorizationNone                 ServiceAuthorizationType = "none"
	ServiceAuthorizationSignalPermission     ServiceAuthorizationType = "signal-written-permission"
	ServiceAuthorizationOfficialTestEndpoint ServiceAuthorizationType = "official-test-endpoint"
	ServiceAuthorizationThrowawayAccount     ServiceAuthorizationType = "throwaway-owned-account"
)

Jump to

Keyboard shortcuts

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