mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-07 00:01:49 +00:00
fix(deno-client): add missing approver encoding to hmac api request (#829)
related to 17064138c2
This commit is contained in:
committed by
GitHub
parent
f38448e494
commit
f7c314b246
+11
-2
@@ -152,8 +152,17 @@ export interface NonceAndHmac {
|
||||
*/
|
||||
export async function genNounceAndHmac(workspace: string, jobId: string, approver?: string): Promise<NonceAndHmac> {
|
||||
const nonce = Math.floor(Math.random() * 4294967295);
|
||||
const sig = await fetch(Deno.env.get("WM_BASE_URL") +
|
||||
`/api/w/${workspace}/jobs/job_signature/${jobId}/${nonce}?token=${Deno.env.get("WM_TOKEN")}${approver ? `&approver=${approver}` : ''}`)
|
||||
const u = new URL(
|
||||
`/api/w/${workspace}/jobs/job_signature/${jobId}/${nonce}`,
|
||||
Deno.env.get("WM_BASE_URL"),
|
||||
);
|
||||
|
||||
u.searchParams.append('token', Deno.env.get("WM_TOKEN"));
|
||||
if (approver) {
|
||||
u.searchParams.append('approver', approver);
|
||||
}
|
||||
|
||||
const sig = await fetch(u.toString());
|
||||
return {
|
||||
nonce,
|
||||
signature: await sig.text()
|
||||
|
||||
Reference in New Issue
Block a user