feat: add codegen for audit.AuditableResources entries (#1370)

This commit is contained in:
Colin Adler
2022-05-10 16:27:45 -05:00
committed by GitHub
parent 97a95f1377
commit f816bbe801
2 changed files with 133 additions and 0 deletions

15
coderd/audit/generate.sh Executable file
View File

@ -0,0 +1,15 @@
#!/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 responsiblity 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
cd "$(dirname "$0")" && cd "$(git rev-parse --show-toplevel)"
go run ./scripts/auditgen ./coderd/database "$@"