Files
coder/enterprise/audit/generate.sh
Kira Pilot e2bea2d20f chore: autogenerate audit log documentation (#5862)
* added script for table creation

* added tags to audit-logs.md

* removed log

* removed empty block line

* PR feedback

* modify check_unstaged

* third times the charm maybe

* spelling

* relative path

* excluding from the right script this time

* sorted resources to ensure table order

* running make cmd

* running make again

* ensuring order on subtable
2023-01-26 18:12:12 -05:00

20 lines
594 B
Bash
Executable File

#!/usr/bin/env bash
# This script facilitates code generation for auditing types. It outputs code
# that can be copied and pasted into the audit.AuditableResources table. By
# default, every field is ignored. It is your responsibility to go through each
# field and document why each field should or should not be audited.
#
# Usage:
# ./generate.sh <database type> <database type> ...
set -euo pipefail
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
PROJECT_ROOT=$(cd "$SCRIPT_DIR" && git rev-parse --show-toplevel)
(
cd "$PROJECT_ROOT"
go run ./scripts/audittypegen ./coderd/database "$@"
)