Documentation
¶
Index ¶
- Constants
- Variables
- func AIGatewayDataPlaneMiddleware(cfg codersdk.AIBridgeConfig) func(http.Handler) http.Handler
- type API
- func (api *API) Authorize(r *http.Request, action policy.Action, object rbac.Objecter) bool
- func (api *API) CheckBuildUsage(_ context.Context, _ database.Store, templateVersion *database.TemplateVersion, ...) (wsbuilder.UsageCheckResponse, error)
- func (api *API) Close() error
- func (api *API) RegisterInMemoryAIBridgeProxydHTTPHandler(srv http.Handler)
- func (api *API) RequireFeatureMW(feat codersdk.FeatureName) func(http.Handler) http.Handler
- type Options
- type TemplateACLUpdateValidator
Constants ¶
const ( AIGatewayProxyPath = agplaibridge.AIGatewayRootPath + "/proxy" AIBridgeProxyPath = agplaibridge.AIBridgeRootPath + "/proxy" )
API route prefixes for the AI Gateway Proxy and legacy AI Bridge Proxy endpoints.
const ( // PubsubEventLicenses is the pubsub event that tells other replicas to // re-read licenses from the database and recompute entitlements. // // It is published and subscribed on api.ReplicaSyncPubsub (always Postgres), // not api.Pubsub. When the NATS pubsub experiment is enabled, api.Pubsub is // the embedded NATS pubsub whose cluster mesh only forms once a replica is // HA-licensed, so propagating license changes over it is circular: a fresh // replica could not learn about the license that would let it join the mesh. // ReplicaSyncPubsub is available as soon as the DB connection is, independent // of clustering or licensing. PubsubEventLicenses = "licenses" )
const TimeFormatHHMM = "15:04"
Variables ¶
var AISpendExportCSVHeader = []string{
"user_id", "username", "group_id", "group_name", "organization_id", "organization_name",
"model", "provider", "provider_name",
"input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens",
"cost_micros", "period_start", "period_end",
}
AISpendExportCSVHeader is the CSV column order for the AI spend export.
Functions ¶
func AIGatewayDataPlaneMiddleware ¶ added in v2.36.0
AIGatewayDataPlaneMiddleware returns the per-request middleware chain that guards the AI Gateway data-plane handler. It is the single source of truth shared by the embedded route and the standalone gateway.
Types ¶
type API ¶
type API struct {
AGPL *coderd.API
*Options
// ProxyHealth checks the reachability of all workspace proxies.
ProxyHealth *proxyhealth.ProxyHealth
// contains filtered or unexported fields
}
func New ¶
New constructs an Enterprise coderd API instance. This handler is designed to wrap the AGPL Coder code and layer Enterprise functionality on top as much as possible.
func (*API) CheckBuildUsage ¶ added in v2.25.0
func (api *API) CheckBuildUsage( _ context.Context, _ database.Store, templateVersion *database.TemplateVersion, task *database.Task, transition database.WorkspaceTransition, ) (wsbuilder.UsageCheckResponse, error)
func (*API) RegisterInMemoryAIBridgeProxydHTTPHandler ¶ added in v2.30.0
RegisterInMemoryAIBridgeProxydHTTPHandler mounts [aibridgeproxyd.Server]'s HTTP handler onto API's router, so that requests to aibridgedproxy will be relayed from Coder's API server to the in-memory aibridgedproxy.
func (*API) RequireFeatureMW ¶ added in v2.14.0
type Options ¶
type Options struct {
*coderd.Options
RBAC bool
AuditLogging bool
ConnectionLogging bool
// Whether to block non-browser connections.
BrowserOnly bool
SCIMAPIKey []byte
// UseLegacySCIM opts into the legacy SCIM handler implementation
// (imulab/go-scim based). This is provided for backward compatibility
// during the transition to the new elimity-com/scim implementation.
// It will be removed in a future release.
UseLegacySCIM bool
ExternalTokenEncryption []dbcrypt.Cipher
// ReplicaManager detects and syncs multiple Coder replicas. When provided,
// the API owns and closes it.
ReplicaManager *replicasync.Manager
// Used for high availability.
ReplicaSyncUpdateInterval time.Duration
ReplicaErrorGracePeriod time.Duration
DERPServerRelayAddress string
DERPServerRegionID int
// Used for user quiet hours schedules.
DefaultQuietHoursSchedule string // cron schedule, if empty user quiet hours schedules are disabled
EntitlementsUpdateInterval time.Duration
ProxyHealthInterval time.Duration
LicenseKeys map[string]ed25519.PublicKey
// optional pre-shared key for authentication of external provisioner daemons
ProvisionerDaemonPSK string
CheckInactiveUsersCancelFunc func()
}
type TemplateACLUpdateValidator ¶ added in v2.26.0
type TemplateACLUpdateValidator codersdk.UpdateTemplateACL
func (TemplateACLUpdateValidator) Groups ¶ added in v2.26.0
func (w TemplateACLUpdateValidator) Groups() (map[string]codersdk.TemplateRole, string)
func (TemplateACLUpdateValidator) Users ¶ added in v2.26.0
func (w TemplateACLUpdateValidator) Users() (map[string]codersdk.TemplateRole, string)
func (TemplateACLUpdateValidator) ValidateRole ¶ added in v2.26.0
func (TemplateACLUpdateValidator) ValidateRole(role codersdk.TemplateRole) error
Source Files
¶
- agentfirewall.go
- aibridge.go
- aibridgeproxy.go
- aibridgeserve.go
- aigatewaykeys.go
- aimodelprices.go
- appearance.go
- coderd.go
- connectionlog.go
- groups.go
- idpsync.go
- licenses.go
- notifications.go
- organizations.go
- prebuilds.go
- provisionerdaemons.go
- provisionerkeys.go
- replicas.go
- roles.go
- scimroutes.go
- templates.go
- userauth.go
- users.go
- workspaceagents.go
- workspaceproxy.go
- workspaceproxycoordinate.go
- workspacequota.go
- workspacesharing.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package httpmw contains middleware for HTTP handlers.
|
Package httpmw contains middleware for HTTP handlers. |
|
Package legacyscim preserves the old imulab/go-scim based SCIM handler.
|
Package legacyscim preserves the old imulab/go-scim based SCIM handler. |
|
Package license provides the license parsing and validation logic for Coderd.
|
Package license provides the license parsing and validation logic for Coderd. |
|
x
|
|