feat: Initial working implementation

This commit is contained in:
Vincent Ambo 2017-02-11 12:27:12 +01:00
parent 33174cbb80
commit 98e81c2c0e
No known key found for this signature in database
GPG key ID: 66F505681DB8F43B
3 changed files with 205 additions and 0 deletions

19
urls.go Normal file
View file

@ -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)
}