How to use @alicloud/fc2 - 1 common examples

To help you get started, we’ve selected a few @alicloud/fc2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / funcraft / lib / local / http.js View on Github external
async function validateSignature(req, res, method) {
  const profile = await getProfile();

  const signature = FC.getSignature(profile.accessKeyId, profile.accessKeySecret, method, req.path, req.headers, req.queries);

  const clientSignature = req.headers['authorization'];

  if (signature !== clientSignature) {
    res.status(500);
    res.send(`Signature doesn't match, request signature is ${clientSignature}, but server signature is ${signature}`);
    return false;
  }

  return true;
}

@alicloud/fc2

Aliyun Function Compute API SDK2

MIT
Latest version published 8 months ago

Package Health Score

56 / 100
Full package analysis

Popular @alicloud/fc2 functions

Similar packages