@Summary Get organization IdP Sync settings @ID get-organization-idp-sync-settings @Security CoderSessionToken @Produce json @Tags Enterprise @Success 200 {object} codersdk.OrganizationSyncSettings @Router /api/v2/settings/idpsync/organization [get]
(rw http.ResponseWriter, r *http.Request)
| 514 | // @Success 200 {object} codersdk.OrganizationSyncSettings |
| 515 | // @Router /api/v2/settings/idpsync/organization [get] |
| 516 | func (api *API) organizationIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { |
| 517 | ctx := r.Context() |
| 518 | |
| 519 | if !api.Authorize(r, policy.ActionRead, rbac.ResourceIdpsyncSettings) { |
| 520 | httpapi.Forbidden(rw) |
| 521 | return |
| 522 | } |
| 523 | |
| 524 | //nolint:gocritic // Requires system context to read runtime config |
| 525 | sysCtx := dbauthz.AsSystemRestricted(ctx) |
| 526 | settings, err := api.IDPSync.OrganizationSyncSettings(sysCtx, api.Database) |
| 527 | if err != nil { |
| 528 | httpapi.InternalServerError(rw, err) |
| 529 | return |
| 530 | } |
| 531 | |
| 532 | httpapi.Write(ctx, rw, http.StatusOK, codersdk.OrganizationSyncSettings{ |
| 533 | Field: settings.Field, |
| 534 | Mapping: settings.Mapping, |
| 535 | AssignDefault: settings.AssignDefault, |
| 536 | }) |
| 537 | } |
| 538 | |
| 539 | // @Summary Update organization IdP Sync settings |
| 540 | // @ID update-organization-idp-sync-settings |
nothing calls this directly
no test coverage detected