Documentation ¶
Index ¶
- func CheckCert(cert *x509.Certificate) (string, error)
- func DirectoryExists(p string) bool
- func EqualAddresses(a, b common.Address) bool
- func ExtractMethod(fullMethod string) string
- func GenerateCert(ethpriv *ecdsa.PrivateKey, validPeriod time.Duration) (cert []byte, key []byte, err error)
- func GetAvailableIPs() (availableIPs []net.IP, err error)
- func GetLocalIP() string
- func GetPlatformName() string
- func GetUserHomeDir() (homeDir string, err error)
- func LoadYamlFile(from string, to interface{}) error
- func MakeGrpcClient(ctx context.Context, addr string, creds credentials.TransportCredentials, ...) (*grpc.ClientConn, error)
- func MakeGrpcServer(creds credentials.TransportCredentials, extraopts ...grpc.ServerOption) *grpc.Server
- func MakeWalletAuthenticatedClient(ctx context.Context, creds credentials.TransportCredentials, endpoint string, ...) (*grpc.ClientConn, error)
- func NewTLS(c *tls.Config) credentials.TransportCredentials
- func NewWalletAccess(wallet *SelfSignedWallet) credentials.PerRPCCredentials
- func NewWalletAuthenticator(c credentials.TransportCredentials, wallet ethcommon.Address) credentials.TransportCredentials
- func ParseBigInt(s string) (*big.Int, error)
- func ParseEndpoint(endpoint string) (string, ethcommon.Address, error)
- func ParseEndpointPort(s string) (string, error)
- func PubKeyToAddr(key ecdsa.PublicKey) common.Address
- func PubKeyToString(key ecdsa.PublicKey) string
- func VerifySelfSignedWallet(signedWallet string) (string, error)
- type EthAuthInfo
- type HitlessCertRotator
- type PortBinding
- type SelfSignedWallet
- type WalletAccess
- type WalletAuthenticator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectoryExists ¶
DirectoryExists returns true if the given directory exists
func EqualAddresses ¶
EqualAddresses checks if provided Addresses are equal
func ExtractMethod ¶
func GenerateCert ¶
func GenerateCert(ethpriv *ecdsa.PrivateKey, validPeriod time.Duration) (cert []byte, key []byte, err error)
GenerateCert generates new PEM encoded x509cert and privatekey key. Generated certificate contains signature of a publick key by eth key
func GetAvailableIPs ¶
func GetPlatformName ¶
func GetPlatformName() string
func GetUserHomeDir ¶
func LoadYamlFile ¶
func MakeGrpcClient ¶
func MakeGrpcClient(ctx context.Context, addr string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error)
MakeGrpcClient creates new gRPC client connection on given addr and wraps it with given credentials
func MakeGrpcServer ¶
func MakeGrpcServer(creds credentials.TransportCredentials, extraopts ...grpc.ServerOption) *grpc.Server
MakeGrpcServer creates new gRPC server
func MakeWalletAuthenticatedClient ¶
func MakeWalletAuthenticatedClient(ctx context.Context, creds credentials.TransportCredentials, endpoint string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func NewTLS ¶
func NewTLS(c *tls.Config) credentials.TransportCredentials
NewTLS wraps TLS TransportCredentials from grpc to add custom logic
func NewWalletAccess ¶
func NewWalletAccess(wallet *SelfSignedWallet) credentials.PerRPCCredentials
NewWalletAccess constructs the new PerRPCCredentials using with given self-signed wallet.
func NewWalletAuthenticator ¶
func NewWalletAuthenticator(c credentials.TransportCredentials, wallet ethcommon.Address) credentials.TransportCredentials
func ParseBigInt ¶
ParseBigInt parses the given string and converts it to *big.Int
func ParseEndpointPort ¶
func PubKeyToString ¶
func VerifySelfSignedWallet ¶
Types ¶
type EthAuthInfo ¶
type EthAuthInfo struct { TLS credentials.TLSInfo Wallet ethcommon.Address }
EthAuthInfo implements credentials.AuthInfo It provides access to a wallet of a connected user
func (EthAuthInfo) AuthType ¶
func (e EthAuthInfo) AuthType() string
AuthType implements credentials.AuthInfo interface
func (EthAuthInfo) WalletAddress ¶
func (e EthAuthInfo) WalletAddress() ethcommon.Address
WalletAddress returns ethereum wallet address.
type HitlessCertRotator ¶
type HitlessCertRotator interface { GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) Close() }
HitlessCertRotator renews TLS cert periodically
func NewHitlessCertRotator ¶
func NewHitlessCertRotator(ctx context.Context, ethPriv *ecdsa.PrivateKey) (HitlessCertRotator, *tls.Config, error)
type PortBinding ¶
type PortBinding interface { // Network shows name of the network (for example, "tcp", "udp"). Network() string // Port describes a port. Port() uint16 }
func ParsePortBinding ¶
func ParsePortBinding(v string) (PortBinding, error)
ParsePortBinding parses the given Docker port binding into components. For example `8080/tcp`.
type SelfSignedWallet ¶
type SelfSignedWallet struct {
Message string
}
func NewSelfSignedWallet ¶
func NewSelfSignedWallet(key *ecdsa.PrivateKey) (*SelfSignedWallet, error)
type WalletAccess ¶
type WalletAccess struct {
// contains filtered or unexported fields
}
WalletAccess supplies PerRPCCredentials from a given self-signed wallet.
func (WalletAccess) GetRequestMetadata ¶
func (WalletAccess) RequireTransportSecurity ¶
func (c WalletAccess) RequireTransportSecurity() bool
type WalletAuthenticator ¶
type WalletAuthenticator struct { credentials.TransportCredentials Wallet ethcommon.Address }
func (*WalletAuthenticator) ClientHandshake ¶
func (*WalletAuthenticator) ServerHandshake ¶
func (w *WalletAuthenticator) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error)