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

Method TemplateVersionExternalAuth

codersdk/templateversions.go:147–158  ·  view source on GitHub ↗

TemplateVersionExternalAuth returns authentication providers for the requested template version.

(ctx context.Context, version uuid.UUID)

Source from the content-addressed store, hash-verified

145
146// TemplateVersionExternalAuth returns authentication providers for the requested template version.
147func (c *Client) TemplateVersionExternalAuth(ctx context.Context, version uuid.UUID) ([]TemplateVersionExternalAuth, error) {
148 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/external-auth", version), nil)
149 if err != nil {
150 return nil, err
151 }
152 defer res.Body.Close()
153 if res.StatusCode != http.StatusOK {
154 return nil, ReadBodyAsError(res)
155 }
156 var extAuth []TemplateVersionExternalAuth
157 return extAuth, json.NewDecoder(res.Body).Decode(&extAuth)
158}
159
160// TemplateVersionResources returns resources a template version declares.
161func (c *Client) TemplateVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error) {

Callers 2

prepWorkspaceBuildFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1