about summary refs log tree commit diff
path: root/urls.go
blob: a1fd825f578cdf480f5d7b369aa15edb537d682f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}