Documentation
¶
Index ¶
Constants ¶
View Source
const ( HeaderSignature = "X-Signature-256" HeaderTimestamp = "X-RDPanel-Timestamp" )
Signature headers. With a secret, X-Signature-256 is "sha256=" + hex(HMAC-SHA256(secret, timestamp + "." + body)) where timestamp is the X-RDPanel-Timestamp value (Unix seconds); receivers should reject stale timestamps to stop replays (docs/configuration.md#webhooks).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
URL string
Secret string
Bus *events.Bus
Log *slog.Logger
Client *http.Client
Now func() time.Time
}
Config configures the webhook dispatcher.
type Payload ¶
type Payload struct {
Event string `json:"event"`
Timestamp time.Time `json:"timestamp"`
Data any `json:"data"`
}
Payload is the JSON structure sent to the webhook endpoint.
Click to show internal directories.
Click to hide internal directories.