You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hyper Queue allows you to create a target webhook endpoint to receive jobs, in order to secure that endpoint to only receive jobs from hyper, you can implement a secret, this secret using sha256 to encode a nounce timestamp and a signature of the job payload. We created a function on hyper_connect to make it easier to implement your own middleware to validate these incoming jobs in a secure way.
/** * Verify a job received from a hyper queue. * See https://docs.hyper.io/post-a-jobtask#sz-verifying-jobs-from-hyper-queue * * @param {string} secret - the secret you provided when creating the queue. * your hyper queue adds a signature to all job requests, using this secret. * @param {string} ttl - the maximum age of a job, in the case of your worker having a constraint * where it should only process jobs if the job was sent within the last 5 minutes * @returns - a function that, given the X-HYPER-SIGNATURE and job payload, * will verify the signature and payload and return a hyper OK response */exportfunctioncreateHyperVerify(secret: string,ttl?: string){returnfunction(signature: string,payload: unknown): Result{returnof({input: { signature, payload }, secret, ttl }).map(splitHyperSignature).chain(createHmacSignature).chain(compareSignatures).chain(verifyTimeGap(ttlasstring)).either(identity,handleSuccess);};}
The text was updated successfully, but these errors were encountered:
hyper Queue allows you to create a target webhook endpoint to receive jobs, in order to secure that endpoint to only receive jobs from hyper, you can implement a secret, this secret using sha256 to encode a
nounce
timestamp and a signature of the job payload. We created a function onhyper_connect
to make it easier to implement your own middleware to validate these incoming jobs in a secure way.JS hyper-connect SDK version: https://github.com/hyper63/hyper/blob/main/packages/connect/deno/utils/hyper-verify.ts
The text was updated successfully, but these errors were encountered: