Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] Add reason and invited fields to SessionStartEvent #51177

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@ message SessionStart {
reserved "AccessRequests";
reserved 11;
// reserved jsontag "access_requests"

// Invited is a list of invited users to this session.
repeated string Invited = 12 [(gogoproto.jsontag) = "invited,omitempty"];

// Reason is the reason for starting this session.
string Reason = 13 [(gogoproto.jsontag) = "reason,omitempty"];
}

// SessionJoin emitted when another user joins a session
Expand Down
5 changes: 5 additions & 0 deletions api/types/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ func (m *SessionStart) TrimToMaxSize(maxSize int) AuditEvent {

out := utils.CloneProtoMsg(m)
out.InitialCommand = nil
out.Invited = nil

maxSize = adjustedMaxSize(out, maxSize)

Expand All @@ -303,6 +304,10 @@ func (m *SessionStart) TrimToMaxSize(maxSize int) AuditEvent {

out.InitialCommand = trimStrSlice(m.InitialCommand, maxFieldSize)

customFieldsCount = nonEmptyStrsInSlice(m.Invited)
maxFieldSize = maxSizePerField(maxSize, customFieldsCount)
out.Invited = trimStrSlice(m.Invited, maxFieldSize)

return out
}

Expand Down
Loading
Loading