Documentation ¶
Overview ¶
Package kms defines the interface and the GRPC implementation for kms plugins. KMS plugins allow to encrypt/decrypt sensitive data.
Index ¶
Constants ¶
View Source
const (
// PluginName defines the name for a kms plugin
PluginName = "kms"
)
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "SFTPGO_PLUGIN_KMS",
MagicCookieValue: "223e3571-7ed2-4b96-b4b3-c7eb87d7ca1d",
}
Handshake is a common handshake that is shared by plugin and host.
View Source
var PluginMap = map[string]plugin.Plugin{ PluginName: &Plugin{}, }
PluginMap is the map of plugins we can dispense.
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is an implementation of KMS interface that talks over RPC.
type GRPCServer ¶
type GRPCServer struct {
Impl Service
}
GRPCServer defines the gRPC server that GRPCClient talks to.
func (*GRPCServer) Decrypt ¶
func (s *GRPCServer) Decrypt(ctx context.Context, req *proto.DecryptRequest) (*proto.DecryptResponse, error)
Decrypt implements the serve side decrypt method
func (*GRPCServer) Encrypt ¶
func (s *GRPCServer) Encrypt(ctx context.Context, req *proto.EncryptRequest) (*proto.EncryptResponse, error)
Encrypt implements the serve side encrypt method
type Plugin ¶
type Plugin struct { plugin.Plugin Impl Service }
Plugin defines the implementation to serve/connect to a notifier plugin
func (*Plugin) GRPCClient ¶
func (p *Plugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient defines the GRPC client implementation for this plugin
Click to show internal directories.
Click to hide internal directories.