mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add ai_gateway_keys table and related RBAC (#25563)
Adds table to store keys that AI Gateway standalone replicas will use to authenticate into Coderd. Also adds RBAC and audit boilerplate.
This commit is contained in:
@@ -8,6 +8,11 @@ import type { RBACAction, RBACResource } from "./typesGenerated";
|
||||
export const RBACResourceActions: Partial<
|
||||
Record<RBACResource, Partial<Record<RBACAction, string>>>
|
||||
> = {
|
||||
ai_gateway_key: {
|
||||
create: "create an AI Gateway key",
|
||||
delete: "delete an AI Gateway key",
|
||||
read: "read AI Gateway keys",
|
||||
},
|
||||
ai_model_price: {
|
||||
read: "read AI model prices",
|
||||
update: "update AI model prices",
|
||||
|
||||
Generated
+12
@@ -518,6 +518,10 @@ export interface APIKey {
|
||||
|
||||
// From codersdk/apikey.go
|
||||
export type APIKeyScope =
|
||||
| "ai_gateway_key:*"
|
||||
| "ai_gateway_key:create"
|
||||
| "ai_gateway_key:delete"
|
||||
| "ai_gateway_key:read"
|
||||
| "ai_model_price:*"
|
||||
| "ai_model_price:read"
|
||||
| "ai_model_price:update"
|
||||
@@ -748,6 +752,10 @@ export type APIKeyScope =
|
||||
| "workspace:update_agent";
|
||||
|
||||
export const APIKeyScopes: APIKeyScope[] = [
|
||||
"ai_gateway_key:*",
|
||||
"ai_gateway_key:create",
|
||||
"ai_gateway_key:delete",
|
||||
"ai_gateway_key:read",
|
||||
"ai_model_price:*",
|
||||
"ai_model_price:read",
|
||||
"ai_model_price:update",
|
||||
@@ -6873,6 +6881,7 @@ export const RBACActions: RBACAction[] = [
|
||||
|
||||
// From codersdk/rbacresources_gen.go
|
||||
export type RBACResource =
|
||||
| "ai_gateway_key"
|
||||
| "ai_provider"
|
||||
| "ai_model_price"
|
||||
| "ai_seat"
|
||||
@@ -6924,6 +6933,7 @@ export type RBACResource =
|
||||
| "workspace_proxy";
|
||||
|
||||
export const RBACResources: RBACResource[] = [
|
||||
"ai_gateway_key",
|
||||
"ai_provider",
|
||||
"ai_model_price",
|
||||
"ai_seat",
|
||||
@@ -7080,6 +7090,7 @@ export interface ResolveAutostartResponse {
|
||||
|
||||
// From codersdk/audit.go
|
||||
export type ResourceType =
|
||||
| "ai_gateway_key"
|
||||
| "ai_provider"
|
||||
| "ai_provider_key"
|
||||
| "ai_seat"
|
||||
@@ -7115,6 +7126,7 @@ export type ResourceType =
|
||||
| "workspace_proxy";
|
||||
|
||||
export const ResourceTypes: ResourceType[] = [
|
||||
"ai_gateway_key",
|
||||
"ai_provider",
|
||||
"ai_provider_key",
|
||||
"ai_seat",
|
||||
|
||||
Reference in New Issue
Block a user