Mattermost-server: Add `PUT /config/patch` REST API endpoint

Created on 29 Oct 2019  路  4Comments  路  Source: mattermost/mattermost-server

Right now the REST API currently only has an endpoint PUT /config that receives a full configuration for the server and applies it. This makes it difficult to make incremental changes to the server's configuration and can also be an issue for any older libraries or drivers that are missing newer config fields.

For this ticket, create a new REST API endpoint PUT /config/patch that uses patch semantics to only update the fields of the config that are provided, while leaving the other fields unchanged.

The config package has a Merge function that will be useful for this.

Please make sure to also update the API documentation here https://github.com/mattermost/mattermost-api-reference


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-19720

AreToolkit Medium Help Wanted PR Exists TecGo

Most helpful comment

I am working on this issue.

All 4 comments

I am working on this issue.

I have few questions. I am referring the update config here: https://github.com/mattermost/mattermost-server/blob/a2adf7b3f5ee106ea81a8996c10e026d87e07e34/api4/config.go#L52-L116

  • What is the significance of c.App.Config().ExperimentalSettings.RestrictSystemAdmin? If only system admin can update the config why this config was added?
  • Do we want to keep the same behaviour for patch as in Update i.e. not allowing plugin uploads to be toggled via UI and the logic to handle cfg.MessageExportSettings.ExportFromTimestamp?
  • What is the use of cfg.MessageExportSettings.ExportFromTimestamp?

@jwilander Could you please take a look at the question above?

@RajatVaryani good questions

  • The RestrictSystemAdmin is helpful when running a bunch of Mattermost severs in a SaaS style where we don't want system admins to be able to change certain settings, instead of anything
  • Yes, same behaviour
  • ExportFromTimestamp is used for a compliance export feature, I'm not super familiar with the feature but I believe that general idea is when the feature is turned on the timestamp can't be any earlier than the current time because the data to export has been being collected (since the feature was off)
Was this page helpful?
0 / 5 - 0 ratings