coderd

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentVersion        = 3
	HeaderKeyID           = "kid"
	AccountTypeSalesforce = "salesforce"
	VersionClaim          = "version"

	PubsubEventLicenses = "licenses"
)

Variables

View Source
var (
	ErrInvalidVersion        = xerrors.New("license must be version 3")
	ErrMissingKeyID          = xerrors.Errorf("JOSE header must contain %s", HeaderKeyID)
	ErrMissingLicenseExpires = xerrors.New("license missing license_expires")
)
View Source
var Keys = map[string]ed25519.PublicKey{"2022-08-12": ed25519.PublicKey(key20220812)}
View Source
var ValidMethods = []string{"EdDSA"}

Functions

This section is empty.

Types

type API added in v0.9.0

type API struct {
	AGPL *coderd.API
	*Options
	// contains filtered or unexported fields
}

func New added in v0.9.0

func New(ctx context.Context, options *Options) (*API, 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) Close added in v0.9.0

func (api *API) Close() error

type Claims

type Claims struct {
	jwt.RegisteredClaims
	// LicenseExpires is the end of the legit license term, and the start of the grace period, if
	// there is one.  The standard JWT claim "exp" (ExpiresAt in jwt.RegisteredClaims, above) is
	// the end of the grace period (identical to LicenseExpires if there is no grace period).
	// The reason we use the standard claim for the end of the grace period is that we want JWT
	// processing libraries to consider the token "valid" until then.
	LicenseExpires *jwt.NumericDate `json:"license_expires,omitempty"`
	AccountType    string           `json:"account_type,omitempty"`
	AccountID      string           `json:"account_id,omitempty"`
	Version        uint64           `json:"version"`
	Features       Features         `json:"features"`
}

type Features

type Features struct {
	UserLimit   int64 `json:"user_limit"`
	AuditLog    int64 `json:"audit_log"`
	BrowserOnly int64 `json:"browser_only"`
	SCIM        int64 `json:"scim"`
}

type Options added in v0.9.0

type Options struct {
	*coderd.Options

	AuditLogging bool
	// Whether to block non-browser connections.
	BrowserOnly                bool
	SCIMAPIKey                 []byte
	EntitlementsUpdateInterval time.Duration
	Keys                       map[string]ed25519.PublicKey
}

type SCIMUser added in v0.9.0

type SCIMUser struct {
	Schemas  []string `json:"schemas"`
	ID       string   `json:"id"`
	UserName string   `json:"userName"`
	Name     struct {
		GivenName  string `json:"givenName"`
		FamilyName string `json:"familyName"`
	} `json:"name"`
	Emails []struct {
		Primary bool   `json:"primary"`
		Value   string `json:"value"`
		Type    string `json:"type"`
		Display string `json:"display"`
	} `json:"emails"`
	Active bool          `json:"active"`
	Groups []interface{} `json:"groups"`
	Meta   struct {
		ResourceType string `json:"resourceType"`
	} `json:"meta"`
}

We currently use our own struct instead of using the SCIM package. This was done mostly because the SCIM package was almost impossible to use. We only need these fields, so it was much simpler to use our own struct. This was tested only with Okta.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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