Documentation ¶
Overview ¶
Package transport implements a transport layer for SillyStack. It uses the Noise protocol to establish a secure connection between two peers using shared Curve25519 keys.
Basically secure service-to-service communication without the headache of certificates. The current implementation is extremely primitive and has many security limitations (probably even flaws, eg. leaking information about the size of the plaintext). But it's a start and will be improved over time.
Index ¶
- func ParsePublicKey(encodedPublicKey string) ([]byte, error)
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(data []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(data []byte) (int, error)
- type CredentialsBuilder
- func (b *CredentialsBuilder) Build() credentials.TransportCredentials
- func (b *CredentialsBuilder) WithKey(key Key) *CredentialsBuilder
- func (b *CredentialsBuilder) WithKnownPeers(knownPeers KnownPeersFunc) *CredentialsBuilder
- func (b *CredentialsBuilder) WithLogger(logger *zap.Logger) *CredentialsBuilder
- func (b *CredentialsBuilder) WithVerifyPeer(verify VerifyPeerFunc) *CredentialsBuilder
- type Key
- type KnownPeersFunc
- type VerifyPeerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePublicKey ¶ added in v0.1.6
ParsePublicKey parses a base64 encoded public key.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) RemoteAddr ¶ added in v0.1.6
type CredentialsBuilder ¶ added in v0.1.6
type CredentialsBuilder struct {
// contains filtered or unexported fields
}
CredentialsBuilder is used to build gRPC transport credentials.
func Builder ¶ added in v0.1.6
func Builder() *CredentialsBuilder
func (*CredentialsBuilder) Build ¶ added in v0.1.6
func (b *CredentialsBuilder) Build() credentials.TransportCredentials
func (*CredentialsBuilder) WithKey ¶ added in v0.1.6
func (b *CredentialsBuilder) WithKey(key Key) *CredentialsBuilder
WithKey sets the current peers private key.
func (*CredentialsBuilder) WithKnownPeers ¶ added in v0.1.6
func (b *CredentialsBuilder) WithKnownPeers(knownPeers KnownPeersFunc) *CredentialsBuilder
WithKnownPeers configures a function that will be used to lookup the public key of known peers. This is only required for clients.
func (*CredentialsBuilder) WithLogger ¶ added in v0.1.6
func (b *CredentialsBuilder) WithLogger(logger *zap.Logger) *CredentialsBuilder
WithLogger can be used to enable logging the handshake process.
func (*CredentialsBuilder) WithVerifyPeer ¶ added in v0.1.6
func (b *CredentialsBuilder) WithVerifyPeer(verify VerifyPeerFunc) *CredentialsBuilder
WithVerifyPeer configures an optional function that will be used to verify a peers public key. This is only required for servers.
type Key ¶ added in v0.1.6
Key is a Curve25519 key pair.
func ParsePrivateKey ¶
ParsePrivateKey parses a base64 encoded private key.
type KnownPeersFunc ¶ added in v0.1.6
KnownPeersFunc is a function that looks up the public key of known peers.
type VerifyPeerFunc ¶ added in v0.1.6
VerifyPeerFunc is used to verify a peers public key.