Documentation ¶
Index ¶
- type Config
- type Plugin
- func (p *Plugin) BrokerHostServices(broker pluginsdk.ServiceBroker) error
- func (p *Plugin) Configure(ctx context.Context, req *configv1.ConfigureRequest) (*configv1.ConfigureResponse, error)
- func (p *Plugin) GenerateKey(ctx context.Context, req *keymanagerv1.GenerateKeyRequest) (*keymanagerv1.GenerateKeyResponse, error)
- func (p *Plugin) GetPublicKey(ctx context.Context, req *keymanagerv1.GetPublicKeyRequest) (*keymanagerv1.GetPublicKeyResponse, error)
- func (p *Plugin) GetPublicKeys(ctx context.Context, req *keymanagerv1.GetPublicKeysRequest) (*keymanagerv1.GetPublicKeysResponse, error)
- func (p *Plugin) SetLogger(logger hclog.Logger)
- func (p *Plugin) SignData(ctx context.Context, req *keymanagerv1.SignDataRequest) (*keymanagerv1.SignDataResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { }
Config defines the configuration for the plugin. TODO: Add relevant configurables or remove if no configuration is required.
type Plugin ¶
type Plugin struct { // UnimplementedKeyManagerServer is embedded to satisfy gRPC keymanagerv1.UnimplementedKeyManagerServer // UnimplementedConfigServer is embedded to satisfy gRPC // TODO: Remove if this plugin does not require configuration configv1.UnimplementedConfigServer // contains filtered or unexported fields }
Plugin implements the KeyManager plugin
func (*Plugin) BrokerHostServices ¶
func (p *Plugin) BrokerHostServices(broker pluginsdk.ServiceBroker) error
BrokerHostServices is called by the framework when the plugin is loaded to give the plugin a chance to obtain clients to SPIRE host services. TODO: Remove if the plugin does not need host services.
func (*Plugin) Configure ¶
func (p *Plugin) Configure(ctx context.Context, req *configv1.ConfigureRequest) (*configv1.ConfigureResponse, error)
Configure configures the plugin. This is invoked by SPIRE when the plugin is first loaded. In the future, it may be invoked to reconfigure the plugin. As such, it should replace the previous configuration atomically. TODO: Remove if no configuration is required
func (*Plugin) GenerateKey ¶
func (p *Plugin) GenerateKey(ctx context.Context, req *keymanagerv1.GenerateKeyRequest) (*keymanagerv1.GenerateKeyResponse, error)
GenerateKey implements the KeyManager GenerateKey RPC. Generates a new private key with the given ID. If a key already exists under that ID, it is overwritten and given a different fingerprint.
func (*Plugin) GetPublicKey ¶
func (p *Plugin) GetPublicKey(ctx context.Context, req *keymanagerv1.GetPublicKeyRequest) (*keymanagerv1.GetPublicKeyResponse, error)
GetPublicKey implements the KeyManager GetPublicKey RPC. Gets the public key information for the private key managed by the plugin with the given ID. If a key with the given ID does not exist, NOT_FOUND is returned.
func (*Plugin) GetPublicKeys ¶
func (p *Plugin) GetPublicKeys(ctx context.Context, req *keymanagerv1.GetPublicKeysRequest) (*keymanagerv1.GetPublicKeysResponse, error)
GetPublicKeys implements the KeyManager GetPublicKeys RPC. Gets all public key information for the private keys managed by the plugin.
func (*Plugin) SetLogger ¶
func (p *Plugin) SetLogger(logger hclog.Logger)
SetLogger is called by the framework when the plugin is loaded and provides the plugin with a logger wired up to SPIRE's logging facilities. TODO: Remove if the plugin does not need the logger.
func (*Plugin) SignData ¶
func (p *Plugin) SignData(ctx context.Context, req *keymanagerv1.SignDataRequest) (*keymanagerv1.SignDataResponse, error)
SignData implements the KeyManager SignData RPC. Signs data with the private key identified by the given ID. If a key with the given ID does not exist, NOT_FOUND is returned. The response contains the signed data and the fingerprint of the key used to sign the data. See the PublicKey message for more details on the role of the fingerprint.