diff options
author | Vincent Ambo <tazjin@gmail.com> | 2017-02-11T11·27+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2017-02-11T11·27+0100 |
commit | 98e81c2c0edd3d9bb483000d598e07e6dd9da6b0 (patch) | |
tree | 030c74862a1ca6990d3a97d6a8ebe85d8b31fb7e /urls.go | |
parent | 33174cbb80a3147fb7bca9b1ac7f462350e7e0c7 (diff) |
feat: Initial working implementation
Diffstat (limited to 'urls.go')
-rw-r--r-- | urls.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/urls.go b/urls.go new file mode 100644 index 000000000000..a1fd825f578c --- /dev/null +++ b/urls.go @@ -0,0 +1,19 @@ +package main + +import "fmt" + +const urlFormat string = "https://%s%s" +const triggerChallengeUri = "/?action=sslvpn_logon&fw_username=%s&fw_password=%s&style=fw_logon_progress.xsl&fw_logon_type=logon&fw_domain=Firebox-DB" +const responseUri = "/?action=sslvpn_logon&style=fw_logon_progress.xsl&fw_logon_type=response&response=%s&fw_logon_id=%d" + +func templateChallengeTriggerUri(username *string, password *string) string { + return fmt.Sprintf(triggerChallengeUri, *username, *password) +} + +func templateResponseUri(logonId int, token *string) string { + return fmt.Sprintf(responseUri, *token, logonId) +} + +func templateUrl(baseUrl *string, uri string) string { + return fmt.Sprintf("https://%s%s", *baseUrl, uri) +} |