forked from tazjin/watchblob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.go
48 lines (39 loc) · 1.18 KB
/
urls.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"fmt"
"net/url"
"strconv"
)
const urlFormat string = "https://%s%s"
const uriFormat = "/?%s"
func templateChallengeTriggerUri(username *string, password *string) string {
v := url.Values{}
v.Set("action", "sslvpn_logon")
v.Set("style", "fw_logon_progress.xsl")
v.Set("fw_logon_type", "logon")
v.Set("fw_domain", "Firebox-DB")
v.Set("fw_username", *username)
v.Set("fw_password", *password)
return fmt.Sprintf(uriFormat, v.Encode())
}
func templateResponseUri(logonId int, token *string) string {
v := url.Values{}
v.Set("action", "sslvpn_logon")
v.Set("style", "fw_logon_progress.xsl")
v.Set("fw_logon_type", "response")
v.Set("fw_logon_id", strconv.Itoa(logonId))
v.Set("response", *token)
return fmt.Sprintf(uriFormat, v.Encode())
}
func templateMfaResponseUri(logonId int, choice *string) string {
v := url.Values{}
v.Set("action", "sslvpn_logon")
v.Set("style", "fw_logon_progress.xsl")
v.Set("fw_logon_type", "mfa_response")
v.Set("fw_logon_id", strconv.Itoa(logonId))
v.Set("mfa_choice", *choice)
return fmt.Sprintf(uriFormat, v.Encode())
}
func templateUrl(baseUrl *string, uri string) string {
return fmt.Sprintf(urlFormat, *baseUrl, uri)
}