feat: Add trial property to licenses (#4372)

* feat: Add trial property to licenses

This allows the frontend to display whether the user is on
a trial license of Coder. This is useful for advertising
Enterprise functionality.

* Improve tests for license enablement code

* Add all features property
This commit is contained in:
Kyle Carberry
2022-10-06 19:28:22 -05:00
committed by GitHub
parent 05670d133e
commit 915bb41ea2
16 changed files with 507 additions and 332 deletions
+2 -2
View File
@@ -21,10 +21,10 @@ import (
func (api *API) scimEnabledMW(next http.Handler) http.Handler {
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
api.entitlementsMu.RLock()
scim := api.entitlements.scim
scim := api.entitlements.Features[codersdk.FeatureSCIM].Enabled
api.entitlementsMu.RUnlock()
if scim == codersdk.EntitlementNotEntitled {
if !scim {
httpapi.RouteNotFound(rw)
return
}