serviceclient

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: 6 Imported by: 0

Documentation

Overview

Package serviceclient defines official Signal service client contracts used by deterministic test doubles and future policy-gated live transports.

Index

Constants

View Source
const UsernameHashSize = 32

Variables

View Source
var (
	ErrInvalidUsernameHash         = errors.New("invalid username hash")
	ErrInvalidUsernameHashHex      = errors.New("invalid username hash hex")
	ErrUsernameHashIndexOutOfRange = errors.New("username hash index out of range")
)
View Source
var (
	ErrMissingTransportClient   = errors.New("missing Signal service transport client")
	ErrMissingSandboxEndpoint   = errors.New("missing Signal service sandbox endpoint")
	ErrUnsupportedTransportMode = errors.New("unsupported Signal service transport mode")
)

Functions

This section is empty.

Types

type DownloadBackupRequest

type DownloadBackupRequest struct {
	Metadata RequestMetadata
	BackupID string
}

type DownloadBackupResponse

type DownloadBackupResponse struct {
	Metadata ResponseMetadata
}

func (DownloadBackupResponse) Common

type LinkDeviceRequest

type LinkDeviceRequest struct {
	Metadata    RequestMetadata
	LinkCodeRef string
}

type LinkDeviceResponse

type LinkDeviceResponse struct {
	Metadata ResponseMetadata
}

func (LinkDeviceResponse) Common

type ReceiveRequest

type ReceiveRequest struct {
	Metadata  RequestMetadata
	CursorRef string
}

type ReceiveResponse

type ReceiveResponse struct {
	Metadata ResponseMetadata
}

func (ReceiveResponse) Common

func (r ReceiveResponse) Common() ResponseMetadata

type RegisterRequest

type RegisterRequest struct {
	Metadata RequestMetadata
	Username string
}

type RegisterResponse

type RegisterResponse struct {
	Metadata ResponseMetadata
}

func (RegisterResponse) Common

type RequestMetadata

type RequestMetadata struct {
	AccountRef       string
	DeviceRef        string
	IdempotencyKey   string
	RequestedAt      time.Time
	ConsentRef       string
	AuditRef         string
	CredentialRef    string
	NonExportableKey string
}

type ReserveUsernameRequest

type ReserveUsernameRequest struct {
	Metadata RequestMetadata
	// Username is kept for legacy fake-only callers. New username reservation
	// flows should pass UsernameHashes or UsernameHashHexes.
	Username                  string
	UsernameHashes            [][]byte
	UsernameHashHexes         []string
	SelectedUsernameHashIndex int
}

func (ReserveUsernameRequest) NormalizedUsernameHashes added in v0.7.0

func (r ReserveUsernameRequest) NormalizedUsernameHashes() ([][]byte, error)

type ReserveUsernameResponse

type ReserveUsernameResponse struct {
	Metadata                ResponseMetadata
	ReservedUsernameHash    []byte
	ReservedUsernameHashHex string
	UsernameHashCount       int
}

func (ReserveUsernameResponse) Common

type RespondToChallengeRequest

type RespondToChallengeRequest struct {
	Metadata     RequestMetadata
	ChallengeRef string
	ResponseRef  string
}

type RespondToChallengeResponse

type RespondToChallengeResponse struct {
	Metadata ResponseMetadata
}

func (RespondToChallengeResponse) Common

type ResponseMetadata

type ResponseMetadata struct {
	RequestID    string
	Status       string
	ChallengeRef string
	SecretRefs   map[string]string
}

type SendRequest

type SendRequest struct {
	Metadata     RequestMetadata
	RecipientRef string
	PayloadRef   string
}

type SendResponse

type SendResponse struct {
	Metadata ResponseMetadata
}

func (SendResponse) Common

func (r SendResponse) Common() ResponseMetadata

type Transport added in v0.4.0

type Transport struct {
	Client
	// contains filtered or unexported fields
}

func NewTransport added in v0.4.0

func NewTransport(client Client, cfg TransportConfig) (*Transport, error)

func (*Transport) Endpoint added in v0.4.0

func (t *Transport) Endpoint() string

func (*Transport) Mode added in v0.4.0

func (t *Transport) Mode() TransportMode

type TransportConfig added in v0.4.0

type TransportConfig struct {
	Mode             TransportMode
	SandboxEndpoint  string
	ApprovalPackage  servicepolicy.ApprovalPackage
	ApprovalTime     time.Time
	RequestedActions []servicepolicy.Action
}

type TransportMode added in v0.4.0

type TransportMode string
const (
	TransportModeFake    TransportMode = "fake"
	TransportModeSandbox TransportMode = "sandbox"
	TransportModeLive    TransportMode = "live"
)

type UploadBackupRequest

type UploadBackupRequest struct {
	Metadata  RequestMetadata
	BackupRef string
}

type UploadBackupResponse

type UploadBackupResponse struct {
	Metadata ResponseMetadata
}

func (UploadBackupResponse) Common

Jump to

Keyboard shortcuts

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