mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
Audit build outcomes/kira pilot (#5143)
* auditing failed builds * logging workspace build successes * remove duplicate workspace build entry * fixed workspacebuilds_test * PR feedback * lint and migrations * fix nil auditors * workspace_build test * fixed workspaces_teest Co-authored-by: Colin Adler <colin1adler@gmail.com>
This commit is contained in:
4
coderd/database/dump.sql
generated
4
coderd/database/dump.sql
generated
@ -143,8 +143,8 @@ CREATE TABLE audit_logs (
|
||||
"time" timestamp with time zone NOT NULL,
|
||||
user_id uuid NOT NULL,
|
||||
organization_id uuid NOT NULL,
|
||||
ip inet NOT NULL,
|
||||
user_agent character varying(256) NOT NULL,
|
||||
ip inet,
|
||||
user_agent character varying(256),
|
||||
resource_type resource_type NOT NULL,
|
||||
resource_id uuid NOT NULL,
|
||||
resource_target text NOT NULL,
|
||||
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE audit_logs ALTER COLUMN ip SET NOT NULL;
|
||||
ALTER TABLE audit_logs ALTER COLUMN user_agent SET NOT NULL;
|
@ -0,0 +1,2 @@
|
||||
ALTER TABLE audit_logs ALTER COLUMN ip DROP NOT NULL;
|
||||
ALTER TABLE audit_logs ALTER COLUMN user_agent DROP NOT NULL;
|
@ -411,7 +411,7 @@ type AuditLog struct {
|
||||
UserID uuid.UUID `db:"user_id" json:"user_id"`
|
||||
OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"`
|
||||
Ip pqtype.Inet `db:"ip" json:"ip"`
|
||||
UserAgent string `db:"user_agent" json:"user_agent"`
|
||||
UserAgent sql.NullString `db:"user_agent" json:"user_agent"`
|
||||
ResourceType ResourceType `db:"resource_type" json:"resource_type"`
|
||||
ResourceID uuid.UUID `db:"resource_id" json:"resource_id"`
|
||||
ResourceTarget string `db:"resource_target" json:"resource_target"`
|
||||
|
@ -455,7 +455,7 @@ type GetAuditLogsOffsetRow struct {
|
||||
UserID uuid.UUID `db:"user_id" json:"user_id"`
|
||||
OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"`
|
||||
Ip pqtype.Inet `db:"ip" json:"ip"`
|
||||
UserAgent string `db:"user_agent" json:"user_agent"`
|
||||
UserAgent sql.NullString `db:"user_agent" json:"user_agent"`
|
||||
ResourceType ResourceType `db:"resource_type" json:"resource_type"`
|
||||
ResourceID uuid.UUID `db:"resource_id" json:"resource_id"`
|
||||
ResourceTarget string `db:"resource_target" json:"resource_target"`
|
||||
@ -562,7 +562,7 @@ type InsertAuditLogParams struct {
|
||||
UserID uuid.UUID `db:"user_id" json:"user_id"`
|
||||
OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"`
|
||||
Ip pqtype.Inet `db:"ip" json:"ip"`
|
||||
UserAgent string `db:"user_agent" json:"user_agent"`
|
||||
UserAgent sql.NullString `db:"user_agent" json:"user_agent"`
|
||||
ResourceType ResourceType `db:"resource_type" json:"resource_type"`
|
||||
ResourceID uuid.UUID `db:"resource_id" json:"resource_id"`
|
||||
ResourceTarget string `db:"resource_target" json:"resource_target"`
|
||||
|
Reference in New Issue
Block a user