mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: audit user AI budget override mutations (#25745)
Relates to https://linear.app/codercom/issue/AIGOV-285/add-user-budget-overrides-table-and-crud-api Adds audit-log support for `user_ai_budget_override` mutations. Without it, an admin could quietly change a user's per-user spend cap (e.g. from `$500` to `$50`), reassign it to a different group, or delete it entirely with no record of who did it. Both write (`create-or-update`) and delete actions now generate audit log entries. Unlike group AI budgets, which only track `spend_limit`, overrides also track `group_name`: an override can be reassigned to a different attributed group, so that change needs to show up in the diff. The raw `spend_limit_micros`, IDs, and timestamps are ignored in favor of the human-readable `spend_limit` and `group_name`. Depends on #25439. ## Screenshot <img width="1343" height="514" alt="image" src="https://github.com/user-attachments/assets/aee30f58-6e81-435e-9bca-5bc98f49d8d3" />
This commit is contained in:
Generated
+2
@@ -22822,6 +22822,7 @@ const docTemplate = `{
|
||||
"ai_provider_key",
|
||||
"ai_gateway_key",
|
||||
"group_ai_budget",
|
||||
"user_ai_budget_override",
|
||||
"chat",
|
||||
"user_secret",
|
||||
"user_skill"
|
||||
@@ -22858,6 +22859,7 @@ const docTemplate = `{
|
||||
"ResourceTypeAIProviderKey",
|
||||
"ResourceTypeAIGatewayKey",
|
||||
"ResourceTypeGroupAIBudget",
|
||||
"ResourceTypeUserAIBudgetOverride",
|
||||
"ResourceTypeChat",
|
||||
"ResourceTypeUserSecret",
|
||||
"ResourceTypeUserSkill"
|
||||
|
||||
Generated
+2
@@ -20929,6 +20929,7 @@
|
||||
"ai_provider_key",
|
||||
"ai_gateway_key",
|
||||
"group_ai_budget",
|
||||
"user_ai_budget_override",
|
||||
"chat",
|
||||
"user_secret",
|
||||
"user_skill"
|
||||
@@ -20965,6 +20966,7 @@
|
||||
"ResourceTypeAIProviderKey",
|
||||
"ResourceTypeAIGatewayKey",
|
||||
"ResourceTypeGroupAIBudget",
|
||||
"ResourceTypeUserAIBudgetOverride",
|
||||
"ResourceTypeChat",
|
||||
"ResourceTypeUserSecret",
|
||||
"ResourceTypeUserSkill"
|
||||
|
||||
Reference in New Issue
Block a user