summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide/bonafide.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-10-01 20:45:43 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-10-02 13:28:36 +0200
commitd4e6561f2d65e2deab3a418f55b4ae4d8b6c8457 (patch)
tree074f245afcafa333e05d1df1d53cb794f41e1a59 /pkg/vpn/bonafide/bonafide.go
parentf798e3f30b6eb69b3655159f07a27571fb737e2b (diff)
[bug] remove apiURL from bonafide
it seems this was an attempt to make this injectable for tests, but it can work by changing config variables too.
Diffstat (limited to 'pkg/vpn/bonafide/bonafide.go')
-rw-r--r--pkg/vpn/bonafide/bonafide.go26
1 files changed, 7 insertions, 19 deletions
diff --git a/pkg/vpn/bonafide/bonafide.go b/pkg/vpn/bonafide/bonafide.go
index fe22deb..973416a 100644
--- a/pkg/vpn/bonafide/bonafide.go
+++ b/pkg/vpn/bonafide/bonafide.go
@@ -48,7 +48,6 @@ type Bonafide struct {
tzOffsetHours int
auth authentication
token []byte
- apiURL string
}
type Gateway struct {
@@ -178,24 +177,13 @@ func (b *Bonafide) GetPemCertificate() ([]byte, error) {
}
func (b *Bonafide) getURL(object string) string {
- if b.apiURL == "" {
- switch object {
- case "cert":
- return config.APIURL + certPathv1
- case "certv3":
- return config.APIURL + certPathv3
- case "auth":
- return config.APIURL + authPathv3
- }
- } else {
- switch object {
- case "cert":
- return b.apiURL + certPathv1
- case "certv3":
- return b.apiURL + certPathv3
- case "auth":
- return b.apiURL + authPathv3
- }
+ switch object {
+ case "cert":
+ return config.APIURL + certPathv1
+ case "certv3":
+ return config.APIURL + certPathv3
+ case "auth":
+ return config.APIURL + authPathv3
}
log.Println("BUG: unknown url object")
return ""