Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2cc56ab

Browse files
authored
chore: fill out workspace owner data for dynamic parameters (#17366)
1 parent ea65ddc commit 2cc56ab

File tree

17 files changed

+635
-345
lines changed

17 files changed

+635
-345
lines changed

coderd/apidoc/docs.go

+37-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+35-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/coderd.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -1108,10 +1108,6 @@ func New(options *Options) *API {
11081108
// The idea is to return an empty [], so that the coder CLI won't get blocked accidentally.
11091109
r.Get("/schema", templateVersionSchemaDeprecated)
11101110
r.Get("/parameters", templateVersionParametersDeprecated)
1111-
r.Group(func(r chi.Router) {
1112-
r.Use(httpmw.RequireExperiment(api.Experiments, codersdk.ExperimentDynamicParameters))
1113-
r.Get("/dynamic-parameters", api.templateVersionDynamicParameters)
1114-
})
11151111
r.Get("/rich-parameters", api.templateVersionRichParameters)
11161112
r.Get("/external-auth", api.templateVersionExternalAuth)
11171113
r.Get("/variables", api.templateVersionVariables)
@@ -1177,6 +1173,17 @@ func New(options *Options) *API {
11771173
// organization member. This endpoint should match the authz story of
11781174
// postWorkspacesByOrganization
11791175
r.Post("/workspaces", api.postUserWorkspaces)
1176+
1177+
// Similarly to creating a workspace, evaluating parameters for a
1178+
// new workspace should also match the authz story of
1179+
// postWorkspacesByOrganization
1180+
r.Route("/templateversions/{templateversion}", func(r chi.Router) {
1181+
r.Use(
1182+
httpmw.ExtractTemplateVersionParam(options.Database),
1183+
httpmw.RequireExperiment(api.Experiments, codersdk.ExperimentDynamicParameters),
1184+
)
1185+
r.Get("/parameters", api.templateVersionDynamicParameters)
1186+
})
11801187
})
11811188

11821189
r.Group(func(r chi.Router) {

0 commit comments

Comments
 (0)