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) GetPublicKey ¶
func (c *Client) GetPublicKey(ctx context.Context, req signer.PublicKeyRequest) (signer.PublicKeyResponse, error)
GetPublicKey implements signer.TransactionSigner.
func (*Client) Sign ¶
func (c *Client) Sign(ctx context.Context, req signer.SigningRequest) (signer.SigningResponse, error)
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 (*Server) GetPublicKey ¶
func (s *Server) GetPublicKey(ctx context.Context, req *signerv1.GetPublicKeyRequest) (*signerv1.GetPublicKeyResponse, error)
GetPublicKey implements signerv1.SignerServiceServer.
func (*Server) Sign ¶
func (s *Server) Sign(ctx context.Context, req *signerv1.SignRequest) (*signerv1.SignResponse, error)
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.