Documentation ¶
Index ¶
- Variables
- type Algorithm
- type BootDevice
- type Config
- func (c *Config) AddSecrets(smap map[Algorithm][]string)
- func (c *Config) BootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
- func (c *Config) Close(_ context.Context) (err error)
- func (c *Config) Name() string
- func (c *Config) Open(ctx context.Context) error
- func (c *Config) PowerSet(ctx context.Context, state string) (ok bool, err error)
- func (c *Config) PowerStateGet(_ context.Context) (state string, err error)
- func (c *Config) SetTLSCert(cert []byte)
- type Payload
- type Task
- type VirtualMedia
Constants ¶
This section is empty.
Variables ¶
View Source
var Features = registrar.Features{ providers.FeaturePowerSet, providers.FeaturePowerState, providers.FeatureBootDeviceSet, }
Features implemented by the AMT provider.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm string
Algorithm is the type for HMAC algorithms.
const ( // ProviderName for the Webook implementation. ProviderName = "Webhook" // ProviderProtocol for the Webhook implementation. ProviderProtocol = "https" // SHA256 is the SHA256 algorithm. SHA256 Algorithm = "sha256" // SHA256Short is the short version of the SHA256 algorithm. SHA256Short Algorithm = "256" // SHA512 is the SHA512 algorithm. SHA512 Algorithm = "sha512" // SHA512Short is the short version of the SHA512 algorithm. SHA512Short Algorithm = "512" )
type BootDevice ¶
type Config ¶
type Config struct { // Host is the BMC ip address or hostname. Host string // ConsumerURL is the URL where a webhook consumer/listener is running and to which we will send notifications. ConsumerURL string // BaseSignatureHeader is the header name that should contain the signature(s). Example: X-Rufio-Signature BaseSignatureHeader string // IncludeAlgoHeader determines whether to append the algorithm to the signature header or not. // Example: X-Rufio-Signature becomes X-Rufio-Signature-256 // When set to false, a header will be added for each algorithm. Example: X-Rufio-Signature-256 and X-Rufio-Signature-512 IncludeAlgoHeader bool // IncludedPayloadHeaders are headers whose values will be included in the signature payload. Example: X-Rufio-Timestamp IncludedPayloadHeaders []string // IncludeAlgoPrefix will prepend the algorithm and an equal sign to the signature. Example: sha256=abc123 IncludeAlgoPrefix bool // Logger is the logger to use for logging. Logger logr.Logger // LogNotifications will log the notifications sent to the webhook consumer/listener. LogNotifications bool // HTTPContentType is the content type to use for the webhook request notification. HTTPContentType string // HTTPMethod is the HTTP method to use for the webhook request notification. HTTPMethod string // contains filtered or unexported fields }
Config defines the configuration for sending webhook notifications.
func New ¶
New returns a new Config for this webhook provider.
Defaults:
BaseSignatureHeader: X-Rufio-Signature IncludeAlgoHeader: true IncludedPayloadHeaders: []string{"X-Rufio-Timestamp"} IncludeAlgoPrefix: true Logger: logr.Discard() LogNotifications: true httpClient: http.DefaultClient
func (*Config) AddSecrets ¶
AddSecrets adds secrets to the Config.
func (*Config) BootDeviceSet ¶
func (c *Config) BootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
BootDeviceSet sends a next boot device webhook notification.
func (*Config) Open ¶
Open a connection to the webhook consumer. For the webhook provider, Open means validating the Config and that communication with the webhook consumer can be established.
func (*Config) PowerStateGet ¶
PowerStateGet gets the power state of a BMC machine.
func (*Config) SetTLSCert ¶
type Task ¶
type Task struct { Power string `json:"power,omitempty"` // Pointers are use so that we can more easily omit the field if it is not set. // This matters because the signature payload is generated from the JSON representation of the struct. BootDevice *BootDevice `json:"bootDevice,omitempty"` VirtualMedia *VirtualMedia `json:"virtualMedia,omitempty"` }
type VirtualMedia ¶
Click to show internal directories.
Click to hide internal directories.