chore: protect organization endpoints with license (#14001)

* chore: move multi-org endpoints into enterprise directory

All multi-organization features are gated behind "premium" licenses. Enterprise licenses can no longer
access organization CRUD.
This commit is contained in:
Steven Masley
2024-07-25 16:07:53 -05:00
committed by GitHub
parent 915f69080a
commit 7ea1a4c686
37 changed files with 2222 additions and 1678 deletions
+21
View File
@@ -240,6 +240,27 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
r.Delete("/", api.deleteWorkspaceProxy)
})
})
r.Group(func(r chi.Router) {
r.Use(
apiKeyMiddleware,
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
)
r.Post("/organizations", api.postOrganizations)
})
r.Group(func(r chi.Router) {
r.Use(
apiKeyMiddleware,
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
httpmw.ExtractOrganizationParam(api.Database),
)
r.Patch("/organizations/{organization}", api.patchOrganization)
r.Delete("/organizations/{organization}", api.deleteOrganization)
})
r.Route("/organizations/{organization}/groups", func(r chi.Router) {
r.Use(
apiKeyMiddleware,