openziti / ziti-webhook-action

Github Action to post a Webhook over a Ziti network
Apache License 2.0
3 stars 0 forks source link

exploring Linux compatibility #9

Closed qrkourier closed 2 years ago

qrkourier commented 2 years ago

I assume that adding the flexibility to use either of the Darwin or Linux runners would entail:

  1. additionally including the Linux counterpart of dist/build/Release/node-v83-darwin-x64/ziti_sdk_nodejs.node
  2. switching logic in dist/index.js to detect the platform and load the appropriate SDK

Is that an accurate summary?

The reason I'm asking is that I may be able to adapt this action slightly to accept additional inputs, and those values would originate from a job that isn't using a MacOS runner. I'm also assuming the function that generates the HMAC is somewhere in this action, not offloaded to a GitHub API, and therefore it will be feasible to modify the webhook payload before generating the hash.

qrkourier commented 2 years ago

confirmed the part about the hash

    // Sign the payload
    let sig = "sha1=" + crypto.createHmac('sha1', webhookSecret).update(payloadBuf).digest('hex');
    let sig256 = "sha256=" + crypto.createHmac('sha256', webhookSecret).update(payloadBuf).digest('hex');
qrkourier commented 2 years ago

Fixed in v2