MCPcopy Index your code
hub / github.com/coder/coder / templateVersionExternalAuth

Method templateVersionExternalAuth

coderd/templateversions.go:334–348  ·  view source on GitHub ↗

@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)

Source from the content-addressed store, hash-verified

332// @Success 200 {array} codersdk.TemplateVersionExternalAuth
333// @Router /api/v2/templateversions/{templateversion}/external-auth [get]
334func (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

Callers

nothing calls this directly

Calls 6

APIKeyFunction · 0.92
TemplateVersionParamFunction · 0.92
WriteResponseErrorFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65

Tested by

no test coverage detected