updatePersistedConfig is a helper function to update the persisted db config for a given db in the rest tester, bypassing the REST API and not (yet) reloading the database. this can be used to test upgrades or changes in behaviour on older configurations (i.e. change a config to an older state that
(dbName string, updateFunc func(*DatabaseConfig))
| 2662 | // updatePersistedConfig is a helper function to update the persisted db config for a given db in the rest tester, bypassing the REST API and not (yet) reloading the database. |
| 2663 | // this can be used to test upgrades or changes in behaviour on older configurations (i.e. change a config to an older state that may not pass new validation rules) |
| 2664 | func (rt *RestTester) updatePersistedConfig(dbName string, updateFunc func(*DatabaseConfig)) { |
| 2665 | // it's safe to just hold the read lock to fetch 'dbName' entry, since we're not modifying the map itself (adding or removing a database by name) |
| 2666 | rt.ServerContext()._databasesLock.RLock() |
| 2667 | defer rt.ServerContext()._databasesLock.RUnlock() |
| 2668 | updateFunc(&rt.ServerContext()._dbConfigs[dbName].DatabaseConfig) |
| 2669 | } |
| 2670 | |
| 2671 | func setChannelsAllCollections(dbConfig DbConfig, principal *auth.PrincipalConfig, channels ...string) { |
| 2672 | if dbConfig.Scopes == nil { |