grpcremote

package
v0.1.0-dev Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package grpcremote is the adapter's `grpc-remote` signer transport: a signer.TransactionSigner client for the sovren.signer.v1.SignerService an exchange's signing system implements (contract: signer-interface.md §Remote signer transports).

Production REQUIRES an authenticated, integrity-protected transport: New refuses a plaintext connection unless AllowInsecureDev is set explicitly. Typed signer errors travel as a gRPC status carrying a SignerErrorDetail; the client maps status+detail back to the kit's signer error codes 1:1.

The package also exports Server, the reference SignerService implementation over any signer.TransactionSigner backend — used by the certification suite and as a starting point for exchange-side services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the grpc-remote signer.TransactionSigner.

func New

func New(cfg Config, extraDialOpts ...grpc.DialOption) (*Client, error)

New dials the remote signer. Plaintext is refused unless cfg.AllowInsecureDev is set (contract: mTLS or equivalent REQUIRED in production).

func (*Client) Close

func (c *Client) Close() error

Close releases the connection.

func (*Client) GetPublicKey

GetPublicKey implements signer.TransactionSigner.

func (*Client) Sign

Sign implements signer.TransactionSigner. The caller (withdrawal processor) owns the FR-035 discipline: a timeout here is never retried without first consulting withdrawal state.

type Config

type Config struct {
	// Target is the gRPC dial target (host:port).
	Target string
	// TLS is REQUIRED in production.
	TLS *TLSConfig
	// AllowInsecureDev permits a plaintext connection for local development
	// ONLY. Never set in production; refused silently nowhere — the choice
	// is always explicit.
	AllowInsecureDev bool
	// CallTimeout bounds each RPC. Zero means 30s.
	CallTimeout time.Duration
}

Config configures the grpc-remote signer client.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server adapts any signer.TransactionSigner to the sovren.signer.v1.SignerService wire contract, mapping typed signer errors to gRPC statuses with SignerErrorDetail. It is the certification test double (backed by signer/local) and a reference for exchange-side signer services; production implementations MUST add their own policy checks over the decoded sign doc before signing.

func NewServer

func NewServer(backend signer.TransactionSigner) *Server

NewServer wraps backend.

func (*Server) GetPublicKey

GetPublicKey implements signerv1.SignerServiceServer.

func (*Server) Sign

Sign implements signerv1.SignerServiceServer.

type TLSConfig

type TLSConfig struct {
	// CAFile is the PEM bundle that must verify the signer server.
	CAFile string
	// CertFile/KeyFile are the adapter's client certificate pair (mTLS).
	CertFile string
	KeyFile  string
	// ServerName overrides SNI/verification when the dial target is not the
	// certificate's DNS name.
	ServerName string
	// AllowServerOnly downgrades the production mTLS requirement to server-only
	// TLS (no client certificate). DEVELOPMENT ONLY: without a client cert any
	// party that can reach the signer can request signatures, so the signer
	// itself is the sole authenticator. Never set in production.
	AllowServerOnly bool
}

TLSConfig configures mutual TLS for the signer connection.

Jump to

Keyboard shortcuts

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