coderd

package
v2.35.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: AGPL-3.0 Imports: 106 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AIGatewayProxyPath = agplaibridge.AIGatewayRootPath + "/proxy"
	AIBridgeProxyPath  = agplaibridge.AIBridgeRootPath + "/proxy"
)

API route prefixes for the AI Gateway Proxy and legacy AI Bridge Proxy endpoints.

View Source
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"
)
View Source
const TimeFormatHHMM = "15:04"

Variables

View Source
var Keys = map[string]ed25519.PublicKey{"2022-08-12": ed25519.PublicKey(key20220812)}

Functions

This section is empty.

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

func New(ctx context.Context, options *Options) (_ *API, err error)

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) Authorize

func (api *API) Authorize(r *http.Request, action policy.Action, object rbac.Objecter) bool

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) Close

func (api *API) Close() error

func (*API) RegisterInMemoryAIBridgeProxydHTTPHandler added in v2.30.0

func (api *API) RegisterInMemoryAIBridgeProxydHTTPHandler(srv http.Handler)

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

func (api *API) RequireFeatureMW(feat codersdk.FeatureName) func(http.Handler) http.Handler

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
	ClusterHost               string // IP or hostname to reach this specific replica
	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 (TemplateACLUpdateValidator) Users added in v2.26.0

func (TemplateACLUpdateValidator) ValidateRole added in v2.26.0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL