Files
mattermost/config/export_test.go
Jesse Hallam 8c8b1bbc9c MM-14441: restrict system admin config (#10477)
* tweak utils.Merge docs

* move merge_test to utils_test package for easier testing

* utils: support MergeConfig and StructFieldFilter

* constrain updating certain fields by the restricted system admin
2019-03-21 15:46:38 -04:00

29 lines
884 B
Go

package config
import (
"io"
"github.com/jmoiron/sqlx"
"github.com/mattermost/mattermost-server/model"
)
// MarshalConfig exposes the internal marshalConfig to tests only.
func MarshalConfig(cfg *model.Config) ([]byte, error) {
return marshalConfig(cfg)
}
// UnmarshalConfig exposes the internal unmarshalConfig to tests only.
func UnmarshalConfig(r io.Reader, allowEnvironmentOverrides bool) (*model.Config, map[string]interface{}, error) {
return unmarshalConfig(r, allowEnvironmentOverrides)
}
// InitializeConfigurationsTable exposes the internal initializeConfigurationsTable to test only.
func InitializeConfigurationsTable(db *sqlx.DB) error {
return initializeConfigurationsTable(db)
}
// ResolveConfigFilePath exposes the internal resolveConfigFilePath to test only.
func ResolveConfigFilePath(path string) (string, error) {
return resolveConfigFilePath(path)
}