Skip to content
Snippets Groups Projects
Unverified Commit 85e61a7d authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[feat] expose allowEmptyPass flag for provider config

parent a0e67fe3
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,7 @@ name = demolib ...@@ -71,6 +71,7 @@ name = demolib
applicationName = DemoLib applicationName = DemoLib
binaryName = demo-lib binaryName = demo-lib
auth = sip auth = sip
authEmptyPass = true
providerURL = vpnlib.bitmask.net providerURL = vpnlib.bitmask.net
apiURL = https://api.vpnlib.bitmask.net:4430/ apiURL = https://api.vpnlib.bitmask.net:4430/
......
...@@ -18,7 +18,7 @@ def getProviderData(provider, config): ...@@ -18,7 +18,7 @@ def getProviderData(provider, config):
c = config[provider] c = config[provider]
d = dict() d = dict()
keys = ('name', 'applicationName', 'binaryName', 'auth', keys = ('name', 'applicationName', 'binaryName', 'auth', 'authEmptyPass',
'providerURL', 'tosURL', 'helpURL', 'providerURL', 'tosURL', 'helpURL',
'askForDonations', 'donateURL', 'apiURL', 'askForDonations', 'donateURL', 'apiURL',
'geolocationAPI', 'caCertString') 'geolocationAPI', 'caCertString')
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"applicationName": "DemoLib", "applicationName": "DemoLib",
"binaryName": "demo-lib", "binaryName": "demo-lib",
"auth": "sip", "auth": "sip",
"authEmptyPass": "true",
"providerURL": "vpnlib.bitmask.net", "providerURL": "vpnlib.bitmask.net",
"tosURL": "https://libraryvpn.org/", "tosURL": "https://libraryvpn.org/",
"helpURL": "https://libraryvpn.org/", "helpURL": "https://libraryvpn.org/",
...@@ -14,7 +15,7 @@ ...@@ -14,7 +15,7 @@
"apiURL": "https://api.vpnlib.bitmask.net:4430/", "apiURL": "https://api.vpnlib.bitmask.net:4430/",
"geolocationAPI": "https://getmyip.vpnlib.bitmask.net/json", "geolocationAPI": "https://getmyip.vpnlib.bitmask.net/json",
"caCertString": "-----BEGIN CERTIFICATE-----\nMIIBQzCB6aADAgECAgEBMAoGCCqGSM49BAMCMBcxFTATBgNVBAMTDExFQVAgUm9v\ndCBDQTAeFw0yMDA4MDYxOTA3NDRaFw0yNTA4MDYxOTEyNDRaMBcxFTATBgNVBAMT\nDExFQVAgUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIG5POr4cAdK\nkTavKpSJr8nW1V7HLpr27qKaShpk1TUy5ipaAlusmavGLxKsPE+i3AMlvf/f6ch3\n1MjAtIf5rYujJjAkMA4GA1UdDwEB/wQEAwICpDASBgNVHRMBAf8ECDAGAQH/AgEB\nMAoGCCqGSM49BAMCA0kAMEYCIQDXj280LNZbSbi0Y2WvtQrJBUw4wdm8qAeOeuH7\n6XiLEwIhAPBRsmst/ujcChsG2t6LpG+p8s4rfIfh8YLo/4qrcc5p\n-----END CERTIFICATE-----", "caCertString": "-----BEGIN CERTIFICATE-----\nMIIBQzCB6aADAgECAgEBMAoGCCqGSM49BAMCMBcxFTATBgNVBAMTDExFQVAgUm9v\ndCBDQTAeFw0yMDA4MDYxOTA3NDRaFw0yNTA4MDYxOTEyNDRaMBcxFTATBgNVBAMT\nDExFQVAgUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIG5POr4cAdK\nkTavKpSJr8nW1V7HLpr27qKaShpk1TUy5ipaAlusmavGLxKsPE+i3AMlvf/f6ch3\n1MjAtIf5rYujJjAkMA4GA1UdDwEB/wQEAwICpDASBgNVHRMBAf8ECDAGAQH/AgEB\nMAoGCCqGSM49BAMCA0kAMEYCIQDXj280LNZbSbi0Y2WvtQrJBUw4wdm8qAeOeuH7\n6XiLEwIhAPBRsmst/ujcChsG2t6LpG+p8s4rfIfh8YLo/4qrcc5p\n-----END CERTIFICATE-----",
"timeStamp": "2020-09-08 01:01:08" "timeStamp": "2020-09-08 03:42:39"
} }
] ]
} }
\ No newline at end of file
...@@ -40,6 +40,7 @@ type ProviderOpts struct { ...@@ -40,6 +40,7 @@ type ProviderOpts struct {
AppName string `json:"applicationName"` AppName string `json:"applicationName"`
BinaryName string `json:"binaryName"` BinaryName string `json:"binaryName"`
Auth string `json:"auth"` Auth string `json:"auth"`
AuthEmptyPass string `json:"authEmptyPass"`
ProviderURL string `json:"providerURL"` ProviderURL string `json:"providerURL"`
DonateURL string `json:"donateURL"` DonateURL string `json:"donateURL"`
ApiURL string `json:"apiURL"` ApiURL string `json:"apiURL"`
...@@ -62,6 +63,7 @@ func ConfigureProvider(opts *ProviderOpts) { ...@@ -62,6 +63,7 @@ func ConfigureProvider(opts *ProviderOpts) {
config.ApplicationName = opts.AppName config.ApplicationName = opts.AppName
config.BinaryName = opts.BinaryName config.BinaryName = opts.BinaryName
config.Auth = opts.Auth config.Auth = opts.Auth
config.DonateURL = opts.DonateURL config.DonateURL = opts.DonateURL
config.HelpURL = opts.HelpURL config.HelpURL = opts.HelpURL
config.TosURL = opts.TosURL config.TosURL = opts.TosURL
...@@ -73,6 +75,12 @@ func ConfigureProvider(opts *ProviderOpts) { ...@@ -73,6 +75,12 @@ func ConfigureProvider(opts *ProviderOpts) {
if err == nil { if err == nil {
config.AskForDonations = wantsDonations config.AskForDonations = wantsDonations
} }
emptyPass, err := strconv.ParseBool(opts.AuthEmptyPass)
if err == nil {
config.AuthEmptyPass = emptyPass
log.Println("DEBUG: provider allows empty pass", emptyPass)
}
} }
func InitializeLogger() { func InitializeLogger() {
......
...@@ -6,6 +6,7 @@ var ( ...@@ -6,6 +6,7 @@ var (
ApplicationName = "" ApplicationName = ""
BinaryName = "" BinaryName = ""
Auth = "" Auth = ""
AuthEmptyPass = false
DonateURL = "" DonateURL = ""
AskForDonations = true AskForDonations = true
HelpURL = "" HelpURL = ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment