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

Method roleIDPSyncSettings

enterprise/coderd/idpsync.go:289–307  ·  view source on GitHub ↗

@Summary Get role IdP Sync settings by organization @ID get-role-idp-sync-settings-by-organization @Security CoderSessionToken @Produce json @Tags Enterprise @Param organization path string true "Organization ID" format(uuid) @Success 200 {object} codersdk.RoleSyncSettings @Router /api/v2/organizati

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

287// @Success 200 {object} codersdk.RoleSyncSettings
288// @Router /api/v2/organizations/{organization}/settings/idpsync/roles [get]
289func (api *API) roleIDPSyncSettings(rw http.ResponseWriter, r *http.Request) {
290 ctx := r.Context()
291 org := httpmw.OrganizationParam(r)
292
293 if !api.Authorize(r, policy.ActionRead, rbac.ResourceIdpsyncSettings.InOrg(org.ID)) {
294 httpapi.Forbidden(rw)
295 return
296 }
297
298 //nolint:gocritic // Requires system context to read runtime config
299 sysCtx := dbauthz.AsSystemRestricted(ctx)
300 settings, err := api.IDPSync.RoleSyncSettings(sysCtx, org.ID, api.Database)
301 if err != nil {
302 httpapi.InternalServerError(rw, err)
303 return
304 }
305
306 httpapi.Write(ctx, rw, http.StatusOK, settings)
307}
308
309// @Summary Update role IdP Sync settings by organization
310// @ID update-role-idp-sync-settings-by-organization

Callers

nothing calls this directly

Calls 9

AuthorizeMethod · 0.95
OrganizationParamFunction · 0.92
ForbiddenFunction · 0.92
AsSystemRestrictedFunction · 0.92
InternalServerErrorFunction · 0.92
WriteFunction · 0.92
InOrgMethod · 0.80
ContextMethod · 0.65
RoleSyncSettingsMethod · 0.65

Tested by

no test coverage detected