Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@anttiviljami/openapi-lambda-adapter
Advanced tools
JavaScript client library for integrating AWS Lambdas with openapi-client-axios
JavaScript/Typescript library for making AWS Lambda to Lambda calls via openapi-client-axios .
client.api.registerRunner(getLambdaRunner('target-lambda-name'))
client.getPet(1)
client.searchPets()
client.searchPets({ ids: [1, 2, 3] })
client.updatePet(1, payload)
Resources:
MyLambda:
Type: AWS::Serverless::Function
Properties:
...
Policies:
- LambdaInvokePolicy:
FunctionName: target-lambda-name
npm install --save openapi-client-axios openapi-lambda-adapter
Setup for single lambda handling all API Gateway requests
import OpenAPIClientAxios from 'openapi-client-axios';
import { getLambdaRunner } from 'openapi-lambda-adapter';
const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });
const client = api.initSync();
client.api.registerRunner(getLambdaRunner('target-lambda-name'));
const res = await client.createPet(null, { name: 'Garfield' });
console.log('Pet created', res.data);
Setup for multiple lambdas, each lambda handling one API Gateway resource
import OpenAPIClientAxios from 'openapi-client-axios';
import { getLambdaRunner } from 'openapi-lambda-adapter';
const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });
const client = api.initSync();
client.api.getOperations().forEach((operation) => {
const lambdaName = ... get lambda-name for operationId
client.api.registerRunner(getLambdaRunner(lambdaName), operation.operationId)
})
const res = await client.createPet(null, { name: 'Garfield' });
console.log('Pet created', res.data);
const resp = await client.getPet({ id: 1 }, null);
console.log('Pet retrieved', resp.data);
FAQs
JavaScript client library for integrating AWS Lambdas with openapi-client-axios
The npm package @anttiviljami/openapi-lambda-adapter receives a total of 1 weekly downloads. As such, @anttiviljami/openapi-lambda-adapter popularity was classified as not popular.
We found that @anttiviljami/openapi-lambda-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.