feat: add AI Gateway coderd key CRUD endpoints (#25565)

Adds create, list and delete endpoints for AI Gateway keys.
Those keys are used to authenticate into Coderd.
All endpoints require Owner permission.
This commit is contained in:
Paweł Banaszewski
2026-06-03 13:50:33 +02:00
committed by GitHub
parent 6ef687cdfb
commit 96e3a64b12
12 changed files with 1281 additions and 19 deletions
+12
View File
@@ -298,6 +298,18 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
r.Route("/aibridge/proxy", aibridgeproxyHandler(api, apiKeyMiddleware))
})
api.AGPL.APIHandler.Group(func(r chi.Router) {
r.Route("/aibridge/keys", func(r chi.Router) {
r.Use(
apiKeyMiddleware,
api.RequireFeatureMW(codersdk.FeatureAIBridge),
)
r.Get("/", api.aiGatewayKeys)
r.Post("/", api.postAIGatewayKey)
r.Delete("/{key}", api.deleteAIGatewayKey)
})
})
api.AGPL.APIHandler.Group(func(r chi.Router) {
r.Get("/entitlements", api.serveEntitlements)
// /regions overrides the AGPL /regions endpoint