tvl-depot/fun/watchblob/urls.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
885 B
Go
Raw Permalink Normal View History

2017-02-11 12:27:12 +01:00
package main
import (
"fmt"
"net/url"
"strconv"
)
2017-02-11 12:27:12 +01:00
const urlFormat string = "https://%s%s"
const uriFormat = "/?%s"
2017-02-11 12:27:12 +01:00
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())
2017-02-11 12:27:12 +01:00
}
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("response", *token)
v.Set("fw_logon_id", strconv.Itoa(logonId))
return fmt.Sprintf(uriFormat, v.Encode())
2017-02-11 12:27:12 +01:00
}
func templateUrl(baseUrl *string, uri string) string {
return fmt.Sprintf(urlFormat, *baseUrl, uri)
2017-02-11 12:27:12 +01:00
}