@Summary Get group IdP Sync settings by organization @ID get-group-idp-sync-settings-by-organization @Security CoderSessionToken @Produce json @Tags Enterprise @Param organization path string true "Organization ID" format(uuid) @Success 200 {object} codersdk.GroupSyncSettings @Router /api/v2/organiz
(rw http.ResponseWriter, r *http.Request)
| 28 | // @Success 200 {object} codersdk.GroupSyncSettings |
| 29 | // @Router /api/v2/organizations/{organization}/settings/idpsync/groups [get] |
| 30 | func (api *API) groupIDPSyncSettings(rw http.ResponseWriter, r *http.Request) { |
| 31 | ctx := r.Context() |
| 32 | org := httpmw.OrganizationParam(r) |
| 33 | |
| 34 | if !api.Authorize(r, policy.ActionRead, rbac.ResourceIdpsyncSettings.InOrg(org.ID)) { |
| 35 | httpapi.Forbidden(rw) |
| 36 | return |
| 37 | } |
| 38 | |
| 39 | //nolint:gocritic // Requires system context to read runtime config |
| 40 | sysCtx := dbauthz.AsSystemRestricted(ctx) |
| 41 | settings, err := api.IDPSync.GroupSyncSettings(sysCtx, org.ID, api.Database) |
| 42 | if err != nil { |
| 43 | httpapi.InternalServerError(rw, err) |
| 44 | return |
| 45 | } |
| 46 | |
| 47 | httpapi.Write(ctx, rw, http.StatusOK, settings) |
| 48 | } |
| 49 | |
| 50 | // @Summary Update group IdP Sync settings by organization |
| 51 | // @ID update-group-idp-sync-settings-by-organization |
nothing calls this directly
no test coverage detected