mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: add cli command to fetch group sync settings as json (#14694)
* chore: add cli command to fetch group sync settings as json
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"github.com/coder/coder/v2/coderd/idpsync"
|
||||
"github.com/coder/coder/v2/coderd/rbac"
|
||||
"github.com/coder/coder/v2/coderd/rbac/policy"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
|
||||
// @Summary Get group IdP Sync settings by organization
|
||||
@ -61,6 +62,20 @@ func (api *API) patchGroupIDPSyncSettings(rw http.ResponseWriter, r *http.Reques
|
||||
return
|
||||
}
|
||||
|
||||
if len(req.LegacyNameMapping) > 0 {
|
||||
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
|
||||
Message: "Unexpected field 'legacy_group_name_mapping'. Field not allowed, set to null or remove it.",
|
||||
Detail: "legacy_group_name_mapping is deprecated, use mapping instead",
|
||||
Validations: []codersdk.ValidationError{
|
||||
{
|
||||
Field: "legacy_group_name_mapping",
|
||||
Detail: "field is not allowed",
|
||||
},
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
//nolint:gocritic // Requires system context to update runtime config
|
||||
sysCtx := dbauthz.AsSystemRestricted(ctx)
|
||||
err := api.IDPSync.UpdateGroupSettings(sysCtx, org.ID, api.Database, req)
|
||||
|
Reference in New Issue
Block a user