mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2026-04-06 09:40:43 +00:00
Allow disabling automatic creation of clients
This may be useful in multi-user deployment scenarios where some external administrative tools are used to create new clients.
This commit is contained in:
@ -24,12 +24,14 @@ impl WebServer {
|
||||
pub fn new<ST: Storage + 'static>(
|
||||
config: ServerConfig,
|
||||
client_id_allowlist: Option<HashSet<Uuid>>,
|
||||
create_clients: bool,
|
||||
storage: ST,
|
||||
) -> Self {
|
||||
Self {
|
||||
server_state: Arc::new(ServerState {
|
||||
server: Server::new(config, storage),
|
||||
client_id_allowlist,
|
||||
create_clients,
|
||||
}),
|
||||
}
|
||||
}
|
||||
@ -57,7 +59,7 @@ mod test {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_cache_control() {
|
||||
let server = WebServer::new(Default::default(), None, InMemoryStorage::new());
|
||||
let server = WebServer::new(Default::default(), None, true, InMemoryStorage::new());
|
||||
let app = App::new().configure(|sc| server.config(sc));
|
||||
let app = test::init_service(app).await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user