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

[v17] Prevent users from seeing notifications for their own access request #50076

Merged
merged 1 commit into from
Dec 11, 2024
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
180 changes: 96 additions & 84 deletions api/gen/proto/go/teleport/notifications/v1/notifications.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions api/proto/teleport/notifications/v1/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ message GlobalNotificationSpec {
bool match_all_conditions = 4;
// notification is the notification itself.
Notification notification = 5;
// exclude_users is a list of usernames of users who should never match this notification
// under any circumstances.
repeated string exclude_users = 6;
}

// ByPermissions represents the RoleConditions needed for a user to receive this notification.
Expand Down
2 changes: 2 additions & 0 deletions lib/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5219,6 +5219,8 @@ func (a *Server) CreateAccessRequestV2(ctx context.Context, req types.AccessRequ
},
},
},
// Prevent the requester from seeing the notification for their own access request.
ExcludeUsers: []string{req.GetUser()},
Notification: &notificationsv1.Notification{
Spec: &notificationsv1.NotificationSpec{},
SubKind: types.NotificationAccessRequestPendingSubKind,
Expand Down
Loading
Loading