Skip to content

Conversation

@ptgott
Copy link
Contributor

@ptgott ptgott commented Oct 10, 2025

No description provided.

ptgott and others added 9 commits October 10, 2025 08:25
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.
@github-actions
Copy link

github-actions bot commented Oct 10, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
paul.gottschling/5044-audit-ts-edits-edits b46e76c 12 ✅SUCCEED paul-gottschling-5044-audit-ts-edits-edits 2025-10-14 14:32:33

@ptgott ptgott force-pushed the paul.gottschling/5044-audit-ts-edits-edits branch from 2d31fc3 to b46e76c Compare October 14, 2025 14:27
@ptgott ptgott closed this Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants