@@ -23,7 +23,7 @@ import (
23
23
func (api * API ) templateVersion (rw http.ResponseWriter , r * http.Request ) {
24
24
templateVersion := httpmw .TemplateVersionParam (r )
25
25
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
26
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
26
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
27
27
return
28
28
}
29
29
@@ -42,7 +42,7 @@ func (api *API) templateVersion(rw http.ResponseWriter, r *http.Request) {
42
42
func (api * API ) patchCancelTemplateVersion (rw http.ResponseWriter , r * http.Request ) {
43
43
templateVersion := httpmw .TemplateVersionParam (r )
44
44
if ! api .Authorize (r , rbac .ActionUpdate , templateVersion ) {
45
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
45
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
46
46
return
47
47
}
48
48
@@ -88,7 +88,7 @@ func (api *API) patchCancelTemplateVersion(rw http.ResponseWriter, r *http.Reque
88
88
func (api * API ) templateVersionSchema (rw http.ResponseWriter , r * http.Request ) {
89
89
templateVersion := httpmw .TemplateVersionParam (r )
90
90
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
91
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
91
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
92
92
return
93
93
}
94
94
@@ -136,7 +136,7 @@ func (api *API) templateVersionParameters(rw http.ResponseWriter, r *http.Reques
136
136
apiKey := httpmw .APIKey (r )
137
137
templateVersion := httpmw .TemplateVersionParam (r )
138
138
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
139
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
139
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
140
140
return
141
141
}
142
142
@@ -180,7 +180,7 @@ func (api *API) postTemplateVersionDryRun(rw http.ResponseWriter, r *http.Reques
180
180
apiKey := httpmw .APIKey (r )
181
181
templateVersion := httpmw .TemplateVersionParam (r )
182
182
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
183
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
183
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
184
184
return
185
185
}
186
186
// We use the workspace RBAC check since we don't want to allow dry runs if
@@ -301,7 +301,7 @@ func (api *API) patchTemplateVersionDryRunCancel(rw http.ResponseWriter, r *http
301
301
}
302
302
if ! api .Authorize (r , rbac .ActionUpdate ,
303
303
rbac .ResourceWorkspace .InOrg (templateVersion .OrganizationID ).WithOwner (job .InitiatorID .String ())) {
304
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
304
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
305
305
return
306
306
}
307
307
@@ -344,7 +344,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re
344
344
jobID = chi .URLParam (r , "jobID" )
345
345
)
346
346
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
347
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
347
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
348
348
return database.ProvisionerJob {}, false
349
349
}
350
350
@@ -403,7 +403,7 @@ func (api *API) fetchTemplateVersionDryRunJob(rw http.ResponseWriter, r *http.Re
403
403
func (api * API ) templateVersionsByTemplate (rw http.ResponseWriter , r * http.Request ) {
404
404
template := httpmw .TemplateParam (r )
405
405
if ! api .Authorize (r , rbac .ActionRead , template ) {
406
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %s " , template .ID ))
406
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %q " , template .ID ))
407
407
return
408
408
}
409
409
@@ -491,7 +491,7 @@ func (api *API) templateVersionsByTemplate(rw http.ResponseWriter, r *http.Reque
491
491
func (api * API ) templateVersionByName (rw http.ResponseWriter , r * http.Request ) {
492
492
template := httpmw .TemplateParam (r )
493
493
if ! api .Authorize (r , rbac .ActionRead , template ) {
494
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %s " , template .ID ))
494
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %q " , template .ID ))
495
495
return
496
496
}
497
497
@@ -531,7 +531,7 @@ func (api *API) templateVersionByName(rw http.ResponseWriter, r *http.Request) {
531
531
func (api * API ) patchActiveTemplateVersion (rw http.ResponseWriter , r * http.Request ) {
532
532
template := httpmw .TemplateParam (r )
533
533
if ! api .Authorize (r , rbac .ActionUpdate , template ) {
534
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %s " , template .ID ))
534
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template %q " , template .ID ))
535
535
return
536
536
}
537
537
@@ -705,7 +705,7 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
705
705
func (api * API ) templateVersionResources (rw http.ResponseWriter , r * http.Request ) {
706
706
templateVersion := httpmw .TemplateVersionParam (r )
707
707
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
708
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
708
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
709
709
return
710
710
}
711
711
@@ -727,7 +727,7 @@ func (api *API) templateVersionResources(rw http.ResponseWriter, r *http.Request
727
727
func (api * API ) templateVersionLogs (rw http.ResponseWriter , r * http.Request ) {
728
728
templateVersion := httpmw .TemplateVersionParam (r )
729
729
if ! api .Authorize (r , rbac .ActionRead , templateVersion ) {
730
- httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %s " , templateVersion .ID ))
730
+ httpapi .ResourceNotFound (rw , fmt .Sprintf ("Template version %q " , templateVersion .ID ))
731
731
return
732
732
}
733
733
0 commit comments