Documentation
¶
Overview ¶
Package plugin provides the toolings to use the notation plugin.
includes a CLIManager and a CLIPlugin implementation.
Index ¶
- Variables
- type CLIManager
- type CLIPlugin
- func (p *CLIPlugin) DescribeKey(ctx context.Context, req *proto.DescribeKeyRequest) (*proto.DescribeKeyResponse, error)
- func (p *CLIPlugin) GenerateEnvelope(ctx context.Context, req *proto.GenerateEnvelopeRequest) (*proto.GenerateEnvelopeResponse, error)
- func (p *CLIPlugin) GenerateSignature(ctx context.Context, req *proto.GenerateSignatureRequest) (*proto.GenerateSignatureResponse, error)
- func (p *CLIPlugin) GetMetadata(ctx context.Context, req *proto.GetMetadataRequest) (*proto.GetMetadataResponse, error)
- func (p *CLIPlugin) VerifySignature(ctx context.Context, req *proto.VerifySignatureRequest) (*proto.VerifySignatureResponse, error)
- type GenericPlugin
- type Manager
- type Plugin
- type SignPlugin
- type VerifyPlugin
Constants ¶
This section is empty.
Variables ¶
var ErrNotCompliant = errors.New("plugin not compliant")
ErrNotCompliant is returned by plugin methods when the response is not compliant.
var ErrNotRegularFile = errors.New("not regular file")
ErrNotRegularFile is returned when the plugin file is not an regular file.
Functions ¶
This section is empty.
Types ¶
type CLIManager ¶
type CLIManager struct {
// contains filtered or unexported fields
}
CLIManager implements Manager
func NewCLIManager ¶
func NewCLIManager(pluginFS dir.SysFS) *CLIManager
NewCLIManager returns CLIManager for named pluginFS.
type CLIPlugin ¶
type CLIPlugin struct {
// contains filtered or unexported fields
}
CLIPlugin implements Plugin interface to CLI plugins.
func NewCLIPlugin ¶
NewCLIPlugin validate the metadata of the plugin and return a *CLIPlugin.
func (*CLIPlugin) DescribeKey ¶
func (p *CLIPlugin) DescribeKey(ctx context.Context, req *proto.DescribeKeyRequest) (*proto.DescribeKeyResponse, error)
DescribeKey returns the KeySpec of a key.
if ContractVersion is not set, it will be set by the function.
func (*CLIPlugin) GenerateEnvelope ¶
func (p *CLIPlugin) GenerateEnvelope(ctx context.Context, req *proto.GenerateEnvelopeRequest) (*proto.GenerateEnvelopeResponse, error)
GenerateEnvelope generates the Envelope with signature based on the request.
if ContractVersion is not set, it will be set by the function.
func (*CLIPlugin) GenerateSignature ¶
func (p *CLIPlugin) GenerateSignature(ctx context.Context, req *proto.GenerateSignatureRequest) (*proto.GenerateSignatureResponse, error)
GenerateSignature generates the raw signature based on the request.
if ContractVersion is not set, it will be set by the function.
func (*CLIPlugin) GetMetadata ¶
func (p *CLIPlugin) GetMetadata(ctx context.Context, req *proto.GetMetadataRequest) (*proto.GetMetadataResponse, error)
GetMetadata returns the metadata information of the plugin.
func (*CLIPlugin) VerifySignature ¶
func (p *CLIPlugin) VerifySignature(ctx context.Context, req *proto.VerifySignatureRequest) (*proto.VerifySignatureResponse, error)
VerifySignature validates the signature based on the request.
if ContractVersion is not set, it will be set by the function.
type GenericPlugin ¶
type GenericPlugin interface {
// GetMetadata returns the metadata information of the plugin.
GetMetadata(ctx context.Context, req *proto.GetMetadataRequest) (*proto.GetMetadataResponse, error)
}
GenericPlugin is the base requirement to be an plugin.
type Manager ¶
type Manager interface {
Get(ctx context.Context, name string) (Plugin, error)
List(ctx context.Context) ([]string, error)
}
Manager manages plugins installed on the system.
type Plugin ¶
type Plugin interface {
SignPlugin
VerifyPlugin
}
Plugin defines required methods to be an Plugin.
type SignPlugin ¶
type SignPlugin interface {
GenericPlugin
// DescribeKey returns the KeySpec of a key.
DescribeKey(ctx context.Context, req *proto.DescribeKeyRequest) (*proto.DescribeKeyResponse, error)
// GenerateSignature generates the raw signature based on the request.
GenerateSignature(ctx context.Context, req *proto.GenerateSignatureRequest) (*proto.GenerateSignatureResponse, error)
// GenerateEnvelope generates the Envelope with signature based on the
// request.
GenerateEnvelope(ctx context.Context, req *proto.GenerateEnvelopeRequest) (*proto.GenerateEnvelopeResponse, error)
}
SignPlugin defines the required methods to be a SignPlugin.
type VerifyPlugin ¶
type VerifyPlugin interface {
GenericPlugin
// VerifySignature validates the signature based on the request.
VerifySignature(ctx context.Context, req *proto.VerifySignatureRequest) (*proto.VerifySignatureResponse, error)
}
VerifyPlugin defines the required method to be a VerifyPlugin.