mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: remove multi-organization and custom role experiment (#14862)
Closes https://github.com/coder/coder/issues/14704 --------- Co-authored-by: Kayla Washburn-Love <mckayla@hey.com>
This commit is contained in:
Generated
-6
@@ -10308,24 +10308,18 @@ const docTemplate = `{
|
||||
"enum": [
|
||||
"example",
|
||||
"auto-fill-parameters",
|
||||
"multi-organization",
|
||||
"custom-roles",
|
||||
"notifications",
|
||||
"workspace-usage"
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
|
||||
"ExperimentCustomRoles": "Allows creating runtime custom roles.",
|
||||
"ExperimentExample": "This isn't used for anything.",
|
||||
"ExperimentMultiOrganization": "Requires organization context for interactions, default org is assumed.",
|
||||
"ExperimentNotifications": "Sends notifications via SMTP and webhooks following certain events.",
|
||||
"ExperimentWorkspaceUsage": "Enables the new workspace usage tracking."
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"ExperimentExample",
|
||||
"ExperimentAutoFillParameters",
|
||||
"ExperimentMultiOrganization",
|
||||
"ExperimentCustomRoles",
|
||||
"ExperimentNotifications",
|
||||
"ExperimentWorkspaceUsage"
|
||||
]
|
||||
|
||||
Generated
-6
@@ -9224,24 +9224,18 @@
|
||||
"enum": [
|
||||
"example",
|
||||
"auto-fill-parameters",
|
||||
"multi-organization",
|
||||
"custom-roles",
|
||||
"notifications",
|
||||
"workspace-usage"
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"ExperimentAutoFillParameters": "This should not be taken out of experiments until we have redesigned the feature.",
|
||||
"ExperimentCustomRoles": "Allows creating runtime custom roles.",
|
||||
"ExperimentExample": "This isn't used for anything.",
|
||||
"ExperimentMultiOrganization": "Requires organization context for interactions, default org is assumed.",
|
||||
"ExperimentNotifications": "Sends notifications via SMTP and webhooks following certain events.",
|
||||
"ExperimentWorkspaceUsage": "Enables the new workspace usage tracking."
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"ExperimentExample",
|
||||
"ExperimentAutoFillParameters",
|
||||
"ExperimentMultiOrganization",
|
||||
"ExperimentCustomRoles",
|
||||
"ExperimentNotifications",
|
||||
"ExperimentWorkspaceUsage"
|
||||
]
|
||||
|
||||
@@ -20,10 +20,9 @@ func ProvisionerDaemonAuthenticated(r *http.Request) bool {
|
||||
}
|
||||
|
||||
type ExtractProvisionerAuthConfig struct {
|
||||
DB database.Store
|
||||
Optional bool
|
||||
PSK string
|
||||
MultiOrgEnabled bool
|
||||
DB database.Store
|
||||
Optional bool
|
||||
PSK string
|
||||
}
|
||||
|
||||
func ExtractProvisionerDaemonAuthenticated(opts ExtractProvisionerAuthConfig) func(next http.Handler) http.Handler {
|
||||
@@ -39,18 +38,6 @@ func ExtractProvisionerDaemonAuthenticated(opts ExtractProvisionerAuthConfig) fu
|
||||
httpapi.Write(ctx, w, code, response)
|
||||
}
|
||||
|
||||
if !opts.MultiOrgEnabled {
|
||||
if opts.PSK == "" {
|
||||
handleOptional(http.StatusUnauthorized, codersdk.Response{
|
||||
Message: "External provisioner daemons not enabled",
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
fallbackToPSK(ctx, opts.PSK, next, w, r, handleOptional)
|
||||
return
|
||||
}
|
||||
|
||||
psk := r.Header.Get(codersdk.ProvisionerDaemonPSK)
|
||||
key := r.Header.Get(codersdk.ProvisionerDaemonKey)
|
||||
if key == "" {
|
||||
|
||||
@@ -2893,8 +2893,6 @@ const (
|
||||
// Add new experiments here!
|
||||
ExperimentExample Experiment = "example" // This isn't used for anything.
|
||||
ExperimentAutoFillParameters Experiment = "auto-fill-parameters" // This should not be taken out of experiments until we have redesigned the feature.
|
||||
ExperimentMultiOrganization Experiment = "multi-organization" // Requires organization context for interactions, default org is assumed.
|
||||
ExperimentCustomRoles Experiment = "custom-roles" // Allows creating runtime custom roles.
|
||||
ExperimentNotifications Experiment = "notifications" // Sends notifications via SMTP and webhooks following certain events.
|
||||
ExperimentWorkspaceUsage Experiment = "workspace-usage" // Enables the new workspace usage tracking.
|
||||
)
|
||||
|
||||
Generated
-2
@@ -2558,8 +2558,6 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
|
||||
| ---------------------- |
|
||||
| `example` |
|
||||
| `auto-fill-parameters` |
|
||||
| `multi-organization` |
|
||||
| `custom-roles` |
|
||||
| `notifications` |
|
||||
| `workspace-usage` |
|
||||
|
||||
|
||||
@@ -37,11 +37,8 @@ func TestEnterpriseCreate(t *testing.T) {
|
||||
// setupMultipleOrganizations creates an extra organization, assigns a member
|
||||
// both organizations, and optionally creates templates in each organization.
|
||||
setupMultipleOrganizations := func(t *testing.T, args setupArgs) setupData {
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
// This only affects the first org.
|
||||
IncludeProvisionerDaemon: true,
|
||||
},
|
||||
|
||||
@@ -25,12 +25,7 @@ func TestEditOrganizationRoles(t *testing.T) {
|
||||
t.Run("JSON", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -68,12 +63,7 @@ func TestEditOrganizationRoles(t *testing.T) {
|
||||
t.Run("InvalidRole", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -119,12 +109,9 @@ func TestShowOrganizations(t *testing.T) {
|
||||
t.Run("OnlyID", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
IncludeProvisionerDaemon: true,
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -159,12 +146,9 @@ func TestShowOrganizations(t *testing.T) {
|
||||
|
||||
t.Run("UsingFlag", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
IncludeProvisionerDaemon: true,
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
|
||||
@@ -20,13 +20,8 @@ func TestRemoveOrganizationMembers(t *testing.T) {
|
||||
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -79,12 +74,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
|
||||
t.Run("CustomRole", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -130,13 +120,7 @@ func TestAssignOrganizationMemberRole(t *testing.T) {
|
||||
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/v2/cli/clitest"
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
"github.com/coder/coder/v2/coderd/rbac"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
|
||||
@@ -24,13 +23,7 @@ func TestUpdateGroupSync(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -81,13 +74,7 @@ func TestUpdateRoleSync(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
owner, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
|
||||
@@ -30,12 +30,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -70,12 +65,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {
|
||||
|
||||
t.Run("AnotherOrgByNameWithUser", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -224,12 +214,7 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) {
|
||||
|
||||
t.Run("ScopeUserAnotherOrg", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -273,8 +258,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments.Append(string(codersdk.ExperimentMultiOrganization))
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
@@ -283,9 +266,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
},
|
||||
},
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
})
|
||||
// nolint:gocritic // test
|
||||
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
|
||||
@@ -319,8 +299,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments.Append(string(codersdk.ExperimentMultiOrganization))
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
@@ -329,9 +307,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
},
|
||||
},
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
})
|
||||
// nolint:gocritic // test
|
||||
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
|
||||
@@ -350,8 +325,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments.Append(string(codersdk.ExperimentMultiOrganization))
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
@@ -360,9 +333,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
},
|
||||
},
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
})
|
||||
// nolint:gocritic // test
|
||||
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
|
||||
@@ -381,8 +351,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments.Append(string(codersdk.ExperimentMultiOrganization))
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
ProvisionerDaemonPSK: "provisionersftw",
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
@@ -391,9 +359,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
},
|
||||
},
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
})
|
||||
anotherOrg := coderdenttest.CreateOrganization(t, client, coderdenttest.CreateOrganizationOptions{})
|
||||
// nolint:gocritic // test
|
||||
|
||||
@@ -23,12 +23,7 @@ func TestProvisionerKeys(t *testing.T) {
|
||||
t.Run("CRUD", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
|
||||
@@ -139,14 +139,8 @@ func TestTemplateCreate(t *testing.T) {
|
||||
t.Run("SecondOrganization", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
// This only affects the first org.
|
||||
IncludeProvisionerDaemon: false,
|
||||
},
|
||||
|
||||
@@ -23,12 +23,9 @@ func TestEnterpriseListTemplates(t *testing.T) {
|
||||
t.Run("MultiOrg", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
IncludeProvisionerDaemon: true,
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
|
||||
"github.com/coder/coder/v2/enterprise/coderd/license"
|
||||
@@ -20,12 +19,7 @@ func TestEnterpriseAuditLogs(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
|
||||
@@ -261,7 +261,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
|
||||
)
|
||||
r.Post("/organizations", api.postOrganizations)
|
||||
})
|
||||
@@ -270,7 +269,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
|
||||
httpmw.ExtractOrganizationParam(api.Database),
|
||||
)
|
||||
r.Patch("/organizations/{organization}", api.patchOrganization)
|
||||
@@ -281,7 +279,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
r.Use(
|
||||
apiKeyMiddleware,
|
||||
api.RequireFeatureMW(codersdk.FeatureCustomRoles),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentCustomRoles),
|
||||
httpmw.ExtractOrganizationParam(api.Database),
|
||||
)
|
||||
r.Post("/organizations/{organization}/members/roles", api.postOrgRoles)
|
||||
@@ -336,7 +333,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
apiKeyMiddleware,
|
||||
httpmw.ExtractOrganizationParam(api.Database),
|
||||
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
|
||||
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
|
||||
)
|
||||
r.Get("/", api.provisionerKeys)
|
||||
r.Post("/", api.postProvisionerKey)
|
||||
@@ -362,10 +358,9 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
|
||||
api.provisionerDaemonsEnabledMW,
|
||||
apiKeyMiddlewareOptional,
|
||||
httpmw.ExtractProvisionerDaemonAuthenticated(httpmw.ExtractProvisionerAuthConfig{
|
||||
DB: api.Database,
|
||||
Optional: true,
|
||||
PSK: api.ProvisionerDaemonPSK,
|
||||
MultiOrgEnabled: api.AGPL.Experiments.Enabled(codersdk.ExperimentMultiOrganization),
|
||||
DB: api.Database,
|
||||
Optional: true,
|
||||
PSK: api.ProvisionerDaemonPSK,
|
||||
}),
|
||||
// Either a user auth or provisioner auth is required
|
||||
// to move forward.
|
||||
|
||||
@@ -25,16 +25,7 @@ func TestGetGroupSyncConfig(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -60,10 +51,6 @@ func TestGetGroupSyncConfig(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
dv.OIDC.GroupField = "legacy-group"
|
||||
dv.OIDC.GroupRegexFilter = serpent.Regexp(*regexp.MustCompile("legacy-filter"))
|
||||
dv.OIDC.GroupMapping = serpent.Struct[map[string]string]{
|
||||
@@ -101,16 +88,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -137,16 +115,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
|
||||
t.Run("NotAuthorized", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -177,16 +146,7 @@ func TestGetRoleSyncConfig(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, _, _, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -220,16 +180,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -256,16 +207,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
|
||||
t.Run("NotAuthorized", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{
|
||||
string(codersdk.ExperimentCustomRoles),
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
owner, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
|
||||
@@ -18,12 +18,7 @@ import (
|
||||
|
||||
func TestMultiOrgFetch(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -60,12 +55,7 @@ func TestOrganizationsByUser(t *testing.T) {
|
||||
t.Run("IsDefault", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -93,12 +83,7 @@ func TestOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("NoMember", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -128,12 +113,7 @@ func TestAddOrganizationMembers(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -174,12 +154,7 @@ func TestDeleteOrganizationsByUser(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("Default", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -201,12 +176,7 @@ func TestDeleteOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("DeleteById", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -224,12 +194,7 @@ func TestDeleteOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("DeleteByName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -250,12 +215,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("Conflict", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -281,12 +241,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("ReservedName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -308,12 +263,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("InvalidName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -335,12 +285,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("UpdateById", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -361,12 +306,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("UpdateByName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -391,12 +331,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("UpdateDisplayName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -422,12 +357,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("UpdateDescription", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -456,12 +386,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("UpdateIcon", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -491,12 +416,7 @@ func TestPatchOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("RevokedLicense", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -534,12 +454,7 @@ func TestPostOrganizationsByUser(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Run("Conflict", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -564,12 +479,7 @@ func TestPostOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("InvalidName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -590,12 +500,7 @@ func TestPostOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("Create", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -620,12 +525,7 @@ func TestPostOrganizationsByUser(t *testing.T) {
|
||||
|
||||
t.Run("CreateWithoutExplicitDisplayName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
|
||||
@@ -597,17 +597,16 @@ func TestProvisionerDaemonServe(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
tcs := []struct {
|
||||
name string
|
||||
psk string
|
||||
multiOrgFeatureEnabled bool
|
||||
multiOrgExperimentEnabled bool
|
||||
insertParams database.InsertProvisionerKeyParams
|
||||
requestProvisionerKey string
|
||||
requestPSK string
|
||||
errStatusCode int
|
||||
name string
|
||||
psk string
|
||||
multiOrgFeatureEnabled bool
|
||||
insertParams database.InsertProvisionerKeyParams
|
||||
requestProvisionerKey string
|
||||
requestPSK string
|
||||
errStatusCode int
|
||||
}{
|
||||
{
|
||||
name: "MultiOrgDisabledPSKAuthOK",
|
||||
name: "PSKAuthOK",
|
||||
psk: "provisionersftw",
|
||||
requestPSK: "provisionersftw",
|
||||
},
|
||||
@@ -618,58 +617,51 @@ func TestProvisionerDaemonServe(t *testing.T) {
|
||||
requestPSK: "provisionersftw",
|
||||
},
|
||||
{
|
||||
name: "MultiOrgFeatureDisabledPSKAuthOK",
|
||||
multiOrgExperimentEnabled: true,
|
||||
psk: "provisionersftw",
|
||||
requestPSK: "provisionersftw",
|
||||
name: "MultiOrgFeatureDisabledPSKAuthOK",
|
||||
psk: "provisionersftw",
|
||||
requestPSK: "provisionersftw",
|
||||
},
|
||||
{
|
||||
name: "MultiOrgEnabledPSKAuthOK",
|
||||
psk: "provisionersftw",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
requestPSK: "provisionersftw",
|
||||
name: "MultiOrgEnabledPSKAuthOK",
|
||||
psk: "provisionersftw",
|
||||
multiOrgFeatureEnabled: true,
|
||||
requestPSK: "provisionersftw",
|
||||
},
|
||||
{
|
||||
name: "MultiOrgEnabledKeyAuthOK",
|
||||
psk: "provisionersftw",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: token,
|
||||
name: "MultiOrgEnabledKeyAuthOK",
|
||||
psk: "provisionersftw",
|
||||
multiOrgFeatureEnabled: true,
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: token,
|
||||
},
|
||||
{
|
||||
name: "MultiOrgEnabledPSKAuthDisabled",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
requestPSK: "provisionersftw",
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
name: "MultiOrgEnabledPSKAuthDisabled",
|
||||
multiOrgFeatureEnabled: true,
|
||||
requestPSK: "provisionersftw",
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
},
|
||||
{
|
||||
name: "InvalidKey",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: "provisionersftw",
|
||||
errStatusCode: http.StatusBadRequest,
|
||||
name: "InvalidKey",
|
||||
multiOrgFeatureEnabled: true,
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: "provisionersftw",
|
||||
errStatusCode: http.StatusBadRequest,
|
||||
},
|
||||
{
|
||||
name: "KeyAndPSK",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
psk: "provisionersftw",
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: token,
|
||||
requestPSK: "provisionersftw",
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
name: "KeyAndPSK",
|
||||
multiOrgFeatureEnabled: true,
|
||||
psk: "provisionersftw",
|
||||
insertParams: insertParams,
|
||||
requestProvisionerKey: token,
|
||||
requestPSK: "provisionersftw",
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
},
|
||||
{
|
||||
name: "None",
|
||||
multiOrgFeatureEnabled: true,
|
||||
multiOrgExperimentEnabled: true,
|
||||
psk: "provisionersftw",
|
||||
insertParams: insertParams,
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
name: "None",
|
||||
multiOrgFeatureEnabled: true,
|
||||
psk: "provisionersftw",
|
||||
insertParams: insertParams,
|
||||
errStatusCode: http.StatusUnauthorized,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -683,9 +675,6 @@ func TestProvisionerDaemonServe(t *testing.T) {
|
||||
features[codersdk.FeatureMultipleOrganizations] = 1
|
||||
}
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
if tc.multiOrgExperimentEnabled {
|
||||
dv.Experiments.Append(string(codersdk.ExperimentMultiOrganization))
|
||||
}
|
||||
client, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: features,
|
||||
@@ -738,7 +727,6 @@ func TestGetProvisionerDaemons(t *testing.T) {
|
||||
t.Run("OK", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
|
||||
@@ -20,7 +20,6 @@ func TestProvisionerKeys(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong*10)
|
||||
t.Cleanup(cancel)
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
|
||||
@@ -41,12 +41,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
// Create, assign, and use a custom role
|
||||
t.Run("Success", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -95,12 +90,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
// use the existing roles.
|
||||
t.Run("RevokedLicense", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -137,12 +127,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
// Role patches are complete, as in the request overrides the existing role.
|
||||
t.Run("RoleOverrides", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -187,12 +172,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
|
||||
t.Run("InvalidName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -216,12 +196,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
|
||||
t.Run("ReservedName", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -246,12 +221,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
// Attempt to add site & user permissions, which is not allowed
|
||||
t.Run("ExcessPermissions", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -288,12 +258,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
|
||||
t.Run("NotFound", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -313,12 +278,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
|
||||
t.Run("Delete", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -373,12 +333,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
// Verify deleting a custom role cascades to all members
|
||||
t.Run("DeleteRoleCascadeMembers", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureCustomRoles: 1,
|
||||
@@ -443,12 +398,7 @@ func TestCustomOrganizationRole(t *testing.T) {
|
||||
func TestListRoles(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureExternalProvisionerDaemons: 1,
|
||||
|
||||
@@ -732,7 +732,6 @@ func TestTemplates(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles), string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -782,7 +781,6 @@ func TestTemplates(t *testing.T) {
|
||||
t.Run("MultipleOrganizations", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -1735,7 +1733,6 @@ func TestTemplateAccess(t *testing.T) {
|
||||
t.Cleanup(cancel)
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -1946,7 +1943,6 @@ func TestMultipleOrganizationTemplates(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
// This only affects the first org.
|
||||
|
||||
@@ -939,7 +939,6 @@ func TestEnterpriseUserLogin(t *testing.T) {
|
||||
t.Run("CustomRole", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -985,13 +984,10 @@ func TestEnterpriseUserLogin(t *testing.T) {
|
||||
// database directly to corrupt it.
|
||||
rawDB, pubsub := dbtestutil.NewDB(t)
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
Database: rawDB,
|
||||
Pubsub: pubsub,
|
||||
Database: rawDB,
|
||||
Pubsub: pubsub,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
@@ -1131,7 +1127,6 @@ func setupOIDCTest(t *testing.T, settings oidcTestConfig) *oidcTestRunner {
|
||||
if settings.DeploymentValues != nil {
|
||||
settings.DeploymentValues(dv)
|
||||
}
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, _, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
OIDCConfig: cfg,
|
||||
|
||||
@@ -249,12 +249,9 @@ func TestCreateFirstUser_Entitlements_Trial(t *testing.T) {
|
||||
// a custom role and assign it to an organization user.
|
||||
func TestAssignCustomOrgRoles(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
|
||||
|
||||
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
IncludeProvisionerDaemon: true,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
@@ -314,7 +311,6 @@ func TestGrantSiteRoles(t *testing.T) {
|
||||
}
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
admin, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -485,8 +481,6 @@ func TestEnterprisePostUser(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -522,8 +516,6 @@ func TestEnterprisePostUser(t *testing.T) {
|
||||
t.Run("OrganizationNoAccess", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -556,8 +548,6 @@ func TestEnterprisePostUser(t *testing.T) {
|
||||
t.Run("CreateWithoutOrg", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
@@ -588,8 +578,6 @@ func TestEnterprisePostUser(t *testing.T) {
|
||||
t.Run("MultipleOrganizations", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
|
||||
client, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
|
||||
@@ -259,12 +259,7 @@ func TestWorkspaceQuota(t *testing.T) {
|
||||
t.Run("AllowanceEveryone", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureTemplateRBAC: 1,
|
||||
|
||||
@@ -50,12 +50,7 @@ func TestCreateWorkspace(t *testing.T) {
|
||||
t.Run("NoTemplateAccess", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureTemplateRBAC: 1,
|
||||
@@ -195,12 +190,7 @@ func TestCreateUserWorkspace(t *testing.T) {
|
||||
t.Run("NoTemplateAccess", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureTemplateRBAC: 1,
|
||||
@@ -1484,12 +1474,9 @@ func TestResolveAutostart(t *testing.T) {
|
||||
func TestAdminViewAllWorkspaces(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
client, user := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
IncludeProvisionerDaemon: true,
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
|
||||
@@ -20,12 +20,7 @@ func TestEnterpriseMembers(t *testing.T) {
|
||||
|
||||
t.Run("Remove", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -104,12 +99,7 @@ func TestEnterpriseMembers(t *testing.T) {
|
||||
t.Run("PostUser", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -145,12 +135,7 @@ func TestEnterpriseMembers(t *testing.T) {
|
||||
|
||||
t.Run("PostUserNotExists", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, _ := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
@@ -174,12 +159,7 @@ func TestEnterpriseMembers(t *testing.T) {
|
||||
t.Run("ListNotInOrg", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dv := coderdtest.DeploymentValues(t)
|
||||
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
|
||||
owner, first := coderdenttest.New(t, &coderdenttest.Options{
|
||||
Options: &coderdtest.Options{
|
||||
DeploymentValues: dv,
|
||||
},
|
||||
LicenseOptions: &coderdenttest.LicenseOptions{
|
||||
Features: license.Features{
|
||||
codersdk.FeatureMultipleOrganizations: 1,
|
||||
|
||||
@@ -23,7 +23,6 @@ func TestWorkspaceApps(t *testing.T) {
|
||||
deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess = serpent.Bool(opts.DangerousAllowPathAppSiteOwnerAccess)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
if opts.DisableSubdomainApps {
|
||||
|
||||
@@ -45,7 +45,6 @@ func TestDERPOnly(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -94,7 +93,6 @@ func TestDERP(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -327,7 +325,6 @@ func TestDERPEndToEnd(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
deploymentValues.DERP.Config.BlockDirect = true
|
||||
|
||||
@@ -467,7 +464,6 @@ func TestDERPMesh(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -610,7 +606,6 @@ func TestWorkspaceProxyDERPMeshProbe(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -722,7 +717,6 @@ func TestWorkspaceProxyDERPMeshProbe(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -811,7 +805,6 @@ func TestWorkspaceProxyDERPMeshProbe(t *testing.T) {
|
||||
deploymentValues := coderdtest.DeploymentValues(t)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
client, closer, api, _ := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
|
||||
@@ -927,7 +920,6 @@ func TestWorkspaceProxyWorkspaceApps(t *testing.T) {
|
||||
deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess = serpent.Bool(opts.DangerousAllowPathAppSiteOwnerAccess)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
proxyStatsCollectorFlushCh := make(chan chan<- struct{}, 1)
|
||||
@@ -998,7 +990,6 @@ func TestWorkspaceProxyWorkspaceApps_BlockDirect(t *testing.T) {
|
||||
deploymentValues.Dangerous.AllowPathAppSiteOwnerAccess = serpent.Bool(opts.DangerousAllowPathAppSiteOwnerAccess)
|
||||
deploymentValues.Experiments = []string{
|
||||
"*",
|
||||
string(codersdk.ExperimentMultiOrganization),
|
||||
}
|
||||
|
||||
proxyStatsCollectorFlushCh := make(chan chan<- struct{}, 1)
|
||||
|
||||
@@ -148,7 +148,7 @@ export default defineConfig({
|
||||
gitAuth.validatePath,
|
||||
),
|
||||
CODER_PPROF_ADDRESS: `127.0.0.1:${coderdPProfPort}`,
|
||||
CODER_EXPERIMENTS: `multi-organization,${e2eFakeExperiment1},${e2eFakeExperiment2}`,
|
||||
CODER_EXPERIMENTS: `${e2eFakeExperiment1},${e2eFakeExperiment2}`,
|
||||
|
||||
// Tests for Deployment / User Authentication / OIDC
|
||||
CODER_OIDC_ISSUER_URL: "https://accounts.google.com",
|
||||
|
||||
Generated
+2
-2
@@ -2090,8 +2090,8 @@ export type Entitlement = "entitled" | "grace_period" | "not_entitled"
|
||||
export const Entitlements: Entitlement[] = ["entitled", "grace_period", "not_entitled"]
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export type Experiment = "auto-fill-parameters" | "custom-roles" | "example" | "multi-organization" | "notifications" | "workspace-usage"
|
||||
export const Experiments: Experiment[] = ["auto-fill-parameters", "custom-roles", "example", "multi-organization", "notifications", "workspace-usage"]
|
||||
export type Experiment = "auto-fill-parameters" | "example" | "notifications" | "workspace-usage"
|
||||
export const Experiments: Experiment[] = ["auto-fill-parameters", "example", "notifications", "workspace-usage"]
|
||||
|
||||
// From codersdk/deployment.go
|
||||
export type FeatureName = "access_control" | "advanced_template_scheduling" | "appearance" | "audit_log" | "browser_only" | "control_shared_ports" | "custom_roles" | "external_provisioner_daemons" | "external_token_encryption" | "high_availability" | "multiple_external_auth" | "multiple_organizations" | "scim" | "template_rbac" | "user_limit" | "user_role_management" | "workspace_batch_actions" | "workspace_proxy"
|
||||
|
||||
@@ -55,9 +55,9 @@ export const DashboardProvider: FC<PropsWithChildren> = ({ children }) => {
|
||||
}
|
||||
|
||||
const hasMultipleOrganizations = organizationsQuery.data.length > 1;
|
||||
const organizationsEnabled =
|
||||
experimentsQuery.data.includes("multi-organization") &&
|
||||
selectFeatureVisibility(entitlementsQuery.data).multiple_organizations;
|
||||
const organizationsEnabled = selectFeatureVisibility(
|
||||
entitlementsQuery.data,
|
||||
).multiple_organizations;
|
||||
|
||||
return (
|
||||
<DashboardContext.Provider
|
||||
|
||||
@@ -282,14 +282,11 @@ const OrganizationSettingsNavigation: FC<
|
||||
Groups
|
||||
</SidebarNavSubItem>
|
||||
)}
|
||||
{organization.permissions.assignOrgRole &&
|
||||
experiments.includes("custom-roles") && (
|
||||
<SidebarNavSubItem
|
||||
href={urlForSubpage(organization.name, "roles")}
|
||||
>
|
||||
Roles
|
||||
</SidebarNavSubItem>
|
||||
)}
|
||||
{organization.permissions.assignOrgRole && (
|
||||
<SidebarNavSubItem href={urlForSubpage(organization.name, "roles")}>
|
||||
Roles
|
||||
</SidebarNavSubItem>
|
||||
)}
|
||||
{organization.permissions.viewProvisioners && (
|
||||
<SidebarNavSubItem
|
||||
href={urlForSubpage(organization.name, "provisioners")}
|
||||
|
||||
Reference in New Issue
Block a user