chore: OpenVPN user and password as nullable
- Username and password can be the empty string for custom provider
This commit is contained in:
@@ -74,7 +74,7 @@ func modifyConfig(lines []string, connection models.Connection,
|
||||
modified = append(modified, "pull-filter ignore \"auth-token\"") // prevent auth failed loop
|
||||
modified = append(modified, "auth-retry nointeract")
|
||||
modified = append(modified, "suppress-timestamps")
|
||||
if settings.User != "" {
|
||||
if *settings.User != "" {
|
||||
modified = append(modified, "auth-user-pass "+openvpn.AuthConf)
|
||||
}
|
||||
modified = append(modified, "verb "+strconv.Itoa(*settings.Verbosity))
|
||||
|
||||
@@ -36,7 +36,7 @@ func Test_modifyConfig(t *testing.T) {
|
||||
"auth bla",
|
||||
},
|
||||
settings: settings.OpenVPN{
|
||||
User: "user",
|
||||
User: stringPtr("user"),
|
||||
Ciphers: []string{"cipher"},
|
||||
Auth: stringPtr("auth"),
|
||||
MSSFix: uint16Ptr(1000),
|
||||
|
||||
Reference in New Issue
Block a user