@Summary Get external auth by template version @ID get-external-auth-by-template-version @Security CoderSessionToken @Produce json @Tags Templates @Param templateversion path string true "Template version ID" format(uuid) @Success 200 {array} codersdk.TemplateVersionExternalAuth @Router /api/v2/temp
(rw http.ResponseWriter, r *http.Request)
| 332 | // @Success 200 {array} codersdk.TemplateVersionExternalAuth |
| 333 | // @Router /api/v2/templateversions/{templateversion}/external-auth [get] |
| 334 | func (api *API) templateVersionExternalAuth(rw http.ResponseWriter, r *http.Request) { |
| 335 | ctx := r.Context() |
| 336 | var ( |
| 337 | apiKey = httpmw.APIKey(r) |
| 338 | templateVersion = httpmw.TemplateVersionParam(r) |
| 339 | ) |
| 340 | |
| 341 | providers, err := api.templateVersionExternalAuthForUser(ctx, templateVersion, apiKey.UserID) |
| 342 | if err != nil { |
| 343 | httperror.WriteResponseError(ctx, rw, err) |
| 344 | return |
| 345 | } |
| 346 | |
| 347 | httpapi.Write(ctx, rw, http.StatusOK, providers) |
| 348 | } |
| 349 | |
| 350 | // templateVersionExternalAuthForUser returns the external auth providers |
| 351 | // referenced by the template version, with Authenticated reporting whether |
nothing calls this directly
no test coverage detected