Skip to content

Commit b968ea3

Browse files
committed
fix compile issues
1 parent ad4f901 commit b968ea3

9 files changed

+10
-10
lines changed

enterprise/coderd/jfrog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (api *API) jfrogEnabledMW(next http.Handler) http.Handler {
107107
// This doesn't actually use the external auth feature but we want
108108
// to lock this behind an enterprise license and it's somewhat
109109
// related to external auth (in that it is JFrog integration).
110-
if !api.entitlements.Enabled(codersdk.FeatureMultipleExternalAuth) {
110+
if !api.Entitlements.Enabled(codersdk.FeatureMultipleExternalAuth) {
111111
httpapi.RouteNotFound(rw)
112112
return
113113
}

enterprise/coderd/licenses.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (api *API) postRefreshEntitlements(rw http.ResponseWriter, r *http.Request)
189189

190190
// Prevent abuse by limiting how often we allow a forced refresh.
191191
now := time.Now()
192-
if ok, wait := api.entitlements.AllowRefresh(now); !ok {
192+
if ok, wait := api.Entitlements.AllowRefresh(now); !ok {
193193
rw.Header().Set("Retry-After", strconv.Itoa(int(wait.Seconds())))
194194
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
195195
Message: fmt.Sprintf("Entitlements already recently refreshed, please wait %d seconds to force a new refresh", int(wait.Seconds())),

enterprise/coderd/provisionerdaemons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939

4040
func (api *API) provisionerDaemonsEnabledMW(next http.Handler) http.Handler {
4141
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
42-
if !api.entitlements.Enabled(codersdk.FeatureExternalProvisionerDaemons) {
42+
if !api.Entitlements.Enabled(codersdk.FeatureExternalProvisionerDaemons) {
4343
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
4444
Message: "External provisioner daemons is an Enterprise feature. Contact sales!",
4545
})

enterprise/coderd/scim.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
func (api *API) scimEnabledMW(next http.Handler) http.Handler {
2727
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
28-
if !api.entitlements.Enabled(codersdk.FeatureSCIM) {
28+
if !api.Entitlements.Enabled(codersdk.FeatureSCIM) {
2929
httpapi.RouteNotFound(rw)
3030
return
3131
}

enterprise/coderd/templates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func (api *API) RequireFeatureMW(feat codersdk.FeatureName) func(http.Handler) h
349349
return func(next http.Handler) http.Handler {
350350
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
351351
// Entitlement must be enabled.
352-
if !api.entitlements.Enabled(feat) {
352+
if !api.Entitlements.Enabled(feat) {
353353
licenseType := "a Premium"
354354
if feat.Enterprise() {
355355
licenseType = "an Enterprise"

enterprise/coderd/userauth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// nolint: revive
1616
func (api *API) setUserGroups(ctx context.Context, logger slog.Logger, db database.Store, userID uuid.UUID, orgGroupNames map[uuid.UUID][]string, createMissingGroups bool) error {
17-
if !api.entitlements.Enabled(codersdk.FeatureTemplateRBAC) {
17+
if !api.Entitlements.Enabled(codersdk.FeatureTemplateRBAC) {
1818
return nil
1919
}
2020

@@ -78,7 +78,7 @@ func (api *API) setUserGroups(ctx context.Context, logger slog.Logger, db databa
7878
}
7979

8080
func (api *API) setUserSiteRoles(ctx context.Context, logger slog.Logger, db database.Store, userID uuid.UUID, roles []string) error {
81-
if !api.entitlements.Enabled(codersdk.FeatureUserRoleManagement) {
81+
if !api.Entitlements.Enabled(codersdk.FeatureUserRoleManagement) {
8282
logger.Warn(ctx, "attempted to assign OIDC user roles without enterprise entitlement, roles left unchanged",
8383
slog.F("user_id", userID), slog.F("roles", roles),
8484
)

enterprise/coderd/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const TimeFormatHHMM = "15:04"
1818

1919
func (api *API) autostopRequirementEnabledMW(next http.Handler) http.Handler {
2020
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
21-
feature, ok := api.entitlements.Feature(codersdk.FeatureAdvancedTemplateScheduling)
21+
feature, ok := api.Entitlements.Feature(codersdk.FeatureAdvancedTemplateScheduling)
2222
if !ok || !feature.Entitlement.Entitled() {
2323
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
2424
Message: "Advanced template scheduling (and user quiet hours schedule) is an Enterprise feature. Contact sales!",

enterprise/coderd/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func (api *API) shouldBlockNonBrowserConnections(rw http.ResponseWriter) bool {
12-
if api.entitlements.Enabled(codersdk.FeatureBrowserOnly) {
12+
if api.Entitlements.Enabled(codersdk.FeatureBrowserOnly) {
1313
httpapi.Write(context.Background(), rw, http.StatusConflict, codersdk.Response{
1414
Message: "Non-browser connections are disabled for your deployment.",
1515
})

enterprise/coderd/workspacequota.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (api *API) workspaceQuota(rw http.ResponseWriter, r *http.Request) {
155155
user = httpmw.UserParam(r)
156156
)
157157

158-
licensed := api.entitlements.Enabled(codersdk.FeatureTemplateRBAC)
158+
licensed := api.Entitlements.Enabled(codersdk.FeatureTemplateRBAC)
159159

160160
// There are no groups and thus no allowance if RBAC isn't licensed.
161161
var quotaAllowance int64 = -1

0 commit comments

Comments
 (0)