Prevent synced CPA values to be updated from the API (#30687)
* Prevents the API from updating synced CPA values The patch functions for CPA values now accept a parameter that checks if they should allow for synced values to be updated, and prevent those updates if necessary * Fix linter * Fix parameter after merge --------- Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es> Co-authored-by: Scott Bishel <scott.bishel@mattermost.com> Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a001367d43
Коммит
2decc2ccdb
@@ -133,6 +133,10 @@ type CPAAttrs struct {
|
||||
SAML string `json:"saml"`
|
||||
}
|
||||
|
||||
func (c *CPAField) IsSynced() bool {
|
||||
return c.Attrs.LDAP != "" || c.Attrs.SAML != ""
|
||||
}
|
||||
|
||||
func (c *CPAField) ToPropertyField() *PropertyField {
|
||||
pf := c.PropertyField
|
||||
|
||||
@@ -234,7 +238,8 @@ func NewCPAFieldFromPropertyField(pf *PropertyField) (*CPAField, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SanitizeAndValidatePropertyValue validates and sanitizes the given property value based on the field type
|
||||
// SanitizeAndValidatePropertyValue validates and sanitizes the given
|
||||
// property value based on the field type
|
||||
func SanitizeAndValidatePropertyValue(cpaField *CPAField, rawValue json.RawMessage) (json.RawMessage, error) {
|
||||
fieldType := cpaField.Type
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user