core: support SMP basic auth / server password (#1358)

This commit is contained in:
Evgeny Poberezkin
2022-11-14 08:04:11 +00:00
committed by GitHub
parent cb0c499f57
commit e14ab0fed0
13 changed files with 45 additions and 25 deletions
+2 -1
View File
@@ -51,7 +51,7 @@ testOpts =
{ dbFilePrefix = undefined,
dbKey = "",
-- dbKey = "this is a pass-phrase to encrypt the database",
smpServers = ["smp://LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=@localhost:5001"],
smpServers = ["smp://LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=:server_password@localhost:5001"],
networkConfig = defaultNetworkConfig,
logConnections = False,
logServerHosts = False,
@@ -275,6 +275,7 @@ serverCfg =
storeLogFile = Nothing,
storeMsgsFile = Nothing,
allowNewQueues = True,
newQueueBasicAuth = Nothing, -- Just "server_password",
messageExpiration = Just defaultMessageExpiration,
inactiveClientExpiration = Just defaultInactiveClientExpiration,
caCertificateFile = "tests/fixtures/tls/ca.crt",
+2
View File
@@ -2869,6 +2869,8 @@ testGetSetSMPServers =
alice #$> ("/smp_servers", id, "no custom SMP servers saved")
alice #$> ("/smp_servers smp://1234-w==@smp1.example.im", id, "ok")
alice #$> ("/smp_servers", id, "smp://1234-w==@smp1.example.im")
alice #$> ("/smp_servers smp://1234-w==:password@smp1.example.im", id, "ok")
alice #$> ("/smp_servers", id, "smp://1234-w==:password@smp1.example.im")
alice #$> ("/smp_servers smp://2345-w==@smp2.example.im;smp://3456-w==@smp3.example.im:5224", id, "ok")
alice #$> ("/smp_servers", id, "smp://2345-w==@smp2.example.im, smp://3456-w==@smp3.example.im:5224")
alice #$> ("/smp_servers default", id, "ok")