coderd

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: AGPL-3.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeFilter added in v0.6.0

func AuthorizeFilter[O rbac.Objecter](api *API, r *http.Request, action rbac.Action, objects []O) []O

Types

type API added in v0.6.1

type API struct {
	*Options

	Handler chi.Router
	// contains filtered or unexported fields
}

func New

func New(options *Options) *API

New constructs a Coder API handler.

func (*API) Authorize added in v0.6.1

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

func (*API) Close added in v0.6.1

func (api *API) Close()

Close waits for all WebSocket connections to drain before returning.

func (*API) ListenProvisionerDaemon added in v0.6.1

func (api *API) ListenProvisionerDaemon(ctx context.Context) (client proto.DRPCProvisionerDaemonClient, err error)

ListenProvisionerDaemon is an in-memory connection to a provisionerd. Useful when starting coderd and provisionerd in the same process.

type GithubOAuth2Config added in v0.4.4

type GithubOAuth2Config struct {
	httpmw.OAuth2Config
	AuthenticatedUser           func(ctx context.Context, client *http.Client) (*github.User, error)
	ListEmails                  func(ctx context.Context, client *http.Client) ([]*github.UserEmail, error)
	ListOrganizationMemberships func(ctx context.Context, client *http.Client) ([]*github.Membership, error)

	AllowSignups       bool
	AllowOrganizations []string
}

GithubOAuth2Provider exposes required functions for the Github authentication flow.

type Options

type Options struct {
	AccessURL *url.URL
	Logger    slog.Logger
	Database  database.Store
	Pubsub    database.Pubsub

	AgentConnectionUpdateFrequency time.Duration
	// APIRateLimit is the minutely throughput rate limit per user or ip.
	// Setting a rate limit <0 will disable the rate limiter across the entire
	// app. Specific routes may have their own limiters.
	APIRateLimit         int
	AWSCertificates      awsidentity.Certificates
	AzureCertificates    x509.VerifyOptions
	GoogleTokenValidator *idtoken.Validator
	GithubOAuth2Config   *GithubOAuth2Config
	ICEServers           []webrtc.ICEServer
	SecureAuthCookie     bool
	SSHKeygenAlgorithm   gitsshkey.Algorithm
	TURNServer           *turnconn.Server
	Authorizer           rbac.Authorizer
	TracerProvider       *sdktrace.TracerProvider
}

Options are requires parameters for Coder to start.

Directories

Path Synopsis
autobuild
schedule
package schedule provides utilities for parsing and deserializing cron-style expressions.
package schedule provides utilities for parsing and deserializing cron-style expressions.
Package database connects to external services for stateful storage.
Package database connects to external services for stateful storage.
util
ptr
Package ptr contains some utility methods related to pointers.
Package ptr contains some utility methods related to pointers.

Jump to

Keyboard shortcuts

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