tailcfg: update rename SSHFailureNotifyRequest and add EventType

This change renames SSHFailureNotifyRequest to SSHEventNotifyRequest
to better reflect the additional events we could add in the future.
This change also adds an EventType used to catagories the events.

Updates tailscale/corp#9967

Signed-off-by: Charlotte Brandhorst-Satzkorn <charlotte@tailscale.com>
This commit is contained in:
Charlotte Brandhorst-Satzkorn 2023-05-04 18:08:11 -07:00 committed by Charlotte Brandhorst-Satzkorn
parent 8d3d48e000
commit 2804327074

View File

@ -2075,9 +2075,11 @@ type SSHRecorderFailureAction struct {
NotifyURL string `json:",omitempty"` NotifyURL string `json:",omitempty"`
} }
// SSHRecordingFailureNotifyRequest is the JSON payload sent to the NotifyURL // SSHEventNotifyRequest is the JSON payload sent to the NotifyURL
// when a recording fails. // for an SSH event.
type SSHRecordingFailureNotifyRequest struct { type SSHEventNotifyRequest struct {
// EventType is the type of notify request being sent.
EventType SSHEventType
// CapVersion is the client's current CapabilityVersion. // CapVersion is the client's current CapabilityVersion.
CapVersion CapabilityVersion CapVersion CapabilityVersion
@ -2093,10 +2095,19 @@ type SSHRecordingFailureNotifyRequest struct {
// LocalUser is the user that was resolved from the SSHUser for the local machine. // LocalUser is the user that was resolved from the SSHUser for the local machine.
LocalUser string LocalUser string
// Attempts is the list of recorders that were attempted, in order. // RecordingAttempts is the list of recorders that were attempted, in order.
Attempts []SSHRecordingAttempt RecordingAttempts []*SSHRecordingAttempt
} }
// SSHEventType defines the event type linked to a SSH action or state.
type SSHEventType int
const (
UnspecifiedSSHEventType SSHEventType = 0
SSHSessionRecordingRejected SSHEventType = 1
SSHSessionRecordingTerminated SSHEventType = 2
)
// SSHRecordingAttempt is a single attempt to start a recording. // SSHRecordingAttempt is a single attempt to start a recording.
type SSHRecordingAttempt struct { type SSHRecordingAttempt struct {
// Recorder is the address of the recorder that was attempted. // Recorder is the address of the recorder that was attempted.