Emit events in CreateAuditStream for v13 clients#34667
Merged
Conversation
tigrato
reviewed
Nov 16, 2023
| case events.IsPermanentEmitError(err): | ||
| g.WithError(err).WithField("event", event). | ||
| Error("Failed to EmitAuditEvent due to a permanent error. Event wil be omitted.") | ||
| continue |
Contributor
There was a problem hiding this comment.
should we return or continue at all?
Will it affect the session recording? Should we log and concurrently record the session to prevent the loss of remaining recordings?
Contributor
Author
There was a problem hiding this comment.
As it is now, returning the error here matches the behavior of v13. If the RPC exits before all session events have been recorded, the caller will just resume the audit stream and try again.
justinas
approved these changes
Nov 17, 2023
rosstimothy
reviewed
Nov 17, 2023
Comment on lines
+366
to
369
| err = trace.NewAggregate(errors...) | ||
| if err != nil { | ||
| switch { | ||
| case events.IsPermanentEmitError(err): |
Contributor
There was a problem hiding this comment.
Do we need to consider the aggregated errors or just the error from recording the event in IsPermanentEmitError?
Contributor
Author
There was a problem hiding this comment.
The v13 auth server considers the aggregated errors, so I figured we should do that here too.
rosstimothy
approved these changes
Nov 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes a regression where some session events (session.start, session.leave, session.end) were not being emitted when a v13 client is connected to a v14 auth server.
Fixes #34596.
Changelog: Fixed auth server not emitting session events for v13 clients