-
Notifications
You must be signed in to change notification settings - Fork 2k
Audit event reference test PR #60137
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
Closed
Closed
Conversation
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
Closes #5044 Closes #10350 One source of Teleport audit event data is the fixtures file we use for testing the audit event view within the Web UI. We usually update our test fixtures when we add an audit event, since we need to display new audit events as expected within the Web UI. This change adds a generator for the audit event reference documentation based on the test fixtures. Previous attempts to generate an audit event reference drew from the Teleport source, rather than test fixtures, using `AuditEvent` declarations (#13615) and naming conventions (#38344), but inconsistencies within the source meant that the resulting generator was inadequate. Implementation details: - Use vite to transpile the test fixture into a library that we can import into a short script. - Alphabetize reference sections by event type. - Ignore "Unknown" event descriptions, leaving these blank. - If one event type includes multiple possible codes, document each code in an H3 section. - Ignore instances of the same code beyond the first occurrence.
Responds to zmb3 feedback. When we add a new event, we need to edit the formatters in `makeEvent.ts` so the event appears in the Web UI. For any event formatter with no test fixture, include the event, type, code, and description in the reference guide using data from the formatter, but don't include an example. Also remove any test fixtures from the guide that don't correspond to a formatter. Also log events with no examples when running the generator so we can add test fixtures later on.
...into web/packages/teleport
- Use a Set instead of a Map in eventsWithoutExamples - Simplify removeUnknowns with filter while adding a return type. - Use reduce instead of forEach in eventsWithoutExamples. - Add missing types to function signatures.
|
Amplify deployment status
|
0bd31be to
1ec35b8
Compare
2d31fc3 to
b46e76c
Compare
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.
No description provided.