feat: add organization details to audit log response (#13961)

* Allow creating test audits with nil org

Not all audit entries have organization IDs, so this will allow us to
test those cases.

* Add organization details to audit log queries

* Add organization to audit log response

This replaces the old ID.  This is a breaking change but organizations
were not being used before.
This commit is contained in:
Asher
2024-07-22 13:28:44 -08:00
committed by GitHub
parent 38c7dcda94
commit a8e6e89f65
16 changed files with 348 additions and 120 deletions

25
coderd/apidoc/docs.go generated
View File

@ -8368,7 +8368,11 @@ const docTemplate = `{
"is_deleted": {
"type": "boolean"
},
"organization": {
"$ref": "#/definitions/codersdk.MinimalOrganization"
},
"organization_id": {
"description": "Deprecated: Use 'organization.id' instead.",
"type": "string",
"format": "uuid"
},
@ -10102,6 +10106,27 @@ const docTemplate = `{
}
}
},
"codersdk.MinimalOrganization": {
"type": "object",
"required": [
"id"
],
"properties": {
"display_name": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
}
}
},
"codersdk.MinimalUser": {
"type": "object",
"required": [