MCPcopy Create free account
hub / github.com/lightdash/lightdash / decrypt

Function decrypt

scripts/dev-github-reconcile.cjs:52–61  ·  view source on GitHub ↗
(buf, secret)

Source from the content-addressed store, hash-verified

50 return Buffer.concat([salt, cipher.getAuthTag(), iv, enc]);
51}
52function decrypt(buf, secret) {
53 const salt = buf.subarray(0, SALT);
54 const tag = buf.subarray(SALT, SALT + TAG);
55 const iv = buf.subarray(SALT + TAG, SALT + TAG + IV);
56 const msg = buf.subarray(SALT + TAG + IV);
57 const key = crypto.pbkdf2Sync(secret, salt, ITER, KEYLEN, DIGEST);
58 const d = crypto.createDecipheriv('aes-256-gcm', key, iv, { authTagLength: TAG });
59 d.setAuthTag(tag);
60 return d.update(msg, undefined, 'utf-8') + d.final('utf-8');
61}
62
63function appJwt() {
64 const appId = need('GITHUB_APP_ID');

Callers 6

stepInstallationFunction · 0.70
stepDbtRepoCheckFunction · 0.70
installationTokenFunction · 0.70
stepDbtRepoRepointFunction · 0.70
stepVerifyTokenFunction · 0.70
stepWarehousePortFixFunction · 0.70

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected