Documentation
¶
Index ¶
Constants ¶
View Source
const ( CurrentVersion = 3 HeaderKeyID = "kid" AccountTypeSalesforce = "salesforce" VersionClaim = "version" )
Variables ¶
View Source
var ( ValidMethods = []string{"EdDSA"} ErrInvalidVersion = xerrors.New("license must be version 3") ErrMissingKeyID = xerrors.Errorf("JOSE header must contain %s", HeaderKeyID) ErrMissingLicenseExpires = xerrors.New("license missing license_expires") )
Functions ¶
func Entitlements ¶
func Entitlements( ctx context.Context, db database.Store, logger slog.Logger, replicaCount int, gitAuthCount int, keys map[string]ed25519.PublicKey, enablements map[string]bool, ) (codersdk.Entitlements, error)
Entitlements processes licenses to return whether features are enabled or not.
Types ¶
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"` Trial bool `json:"trial"` AllFeatures bool `json:"all_features"` 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"` TemplateRBAC int64 `json:"template_rbac"` HighAvailability int64 `json:"high_availability"` MultipleGitAuth int64 `json:"multiple_git_auth"` ExternalProvisionerDaemons int64 `json:"external_provisioner_daemons"` ServiceBanners int64 `json:"service_banners"` }
Click to show internal directories.
Click to hide internal directories.