Skip to content

Commit

Permalink
Remove unused func in client request utils
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Apr 13, 2024
1 parent e2e7394 commit 5b881b5
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions client/main/RequestUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference path="../References.d.ts"/>
import * as Auth from "./Auth";
import * as Request from "./Request"
import crypto from "crypto";
Expand Down Expand Up @@ -66,28 +65,3 @@ export function del(path: string): Request.Request {

return req
}

export function authGet(host: string, path: string,
token: string, secret: string): Request.Request {

let req = new Request.Request()

req.get(host + path)
.set("Auth-Token", Auth.token)
.set("User-Agent", "pritunl")

let authTimestamp = Math.floor(new Date().getTime() / 1000).toString()
let authNonce = MiscUtils.nonce()
let authString = [token, authTimestamp, authNonce, "get", path].join("&")
let authSignature = crypto.createHmac("sha512", secret).update(
authString).digest("base64")

req.secure(false)
.set("Auth-Token", token)
.set("Auth-Timestamp", authTimestamp)
.set("Auth-Nonce", authNonce)
.set("Auth-Signature", authSignature)

return req

}

0 comments on commit 5b881b5

Please sign in to comment.