Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@serverless/platform-sdk
Advanced tools
Functional SDK for the Serverless Platfrom.
npm i -s @serverless/platform-sdk
login
Opens a browser for the user to login, along with a running server awaiting auth data once the user logs in.
Parameters
None
Returns
Promise resolving to the following object:
username
- string
- dashboard usernameaccessToken
- string
- Auth0 access tokenidToken
- string
- Auth0 idTokenexpiresAt
- string
- epoch time at which the idToken expiresExample
const { login } = require('@serverless/platform-sdk')
const { username, accessToken, idToken, expiresAt } = await login()
createAccessKey
Creates a platform access key for the authenticated user.
Parameters
Object
username
- string
- dashboard usernametenant
- string
- dashboard tenantidToken
- string
- Auth0 idTokentitle
- string
- title of the access keyReturns
Promise resolving to an accessKey
string, that is the access key.
Example
const { createAccessKey } = require('@serverless/platform-sdk')
const data = {
username: 'eahefnawy',
tenant: 'eahefnawy',
idToken: 'abc',
title: 'Framework'
}
const accessKey = await createAccessKey(data)
publishService
Publishes a service to the platform.
Parameters
Object
tenant
- string
- dashboard tenantaccessKey
- string
- dashboard access keyapp
- string
- service appservice
- object
- service object
name
- string
- service namestage
- string
- service stagefunctions
- array
- list of functions to publish. Each array item is an object
with the following structure:
functionId
- string
- unique function identifierdetails
- object
- function details datapackage
- object
- package details datasubscriptions
- array
- list of functions to publish. Each array item is an object
with the following structure:
functionId
- string
- unique function identifier this subscription belongs tosubscriptionId
- string
- unique subscription identifiertype
- string
- type of subscription (ie. aws.s3.objectCreated
or user.created
)event
- object
- event dataReturns
Promise resolving to a serviceUrl
string that is the service url.
Example
const { publishService } = require('@serverless/platform-sdk')
const data = {
tenant: 'eahefnawy',
accessKey: 'abc',
app: 'my-app',
service: {
name: 'my-service',
},
functions: [{
functionId: 'abc',
memory: 512
...
}],
subscriptions: [{
functionId: 'abc',
subscriptionId: 'abc',
type: 'aws.apigateway.http',
event: {
path: 'users',
method: 'get',
...
}
}]
}
const serviceUrl = await publishService(data)
archiveService
Archives a service in the platform.
Parameters
Object
tenant
- string
- dashboard tenantaccessKey
- string
- dashboard access keyapp
- string
- service appname
- string
- service nameReturns
None
Example
const { archiveService } = require('@serverless/platform-sdk')
const data = {
tenant: 'eahefnawy',
accessKey: 'abc',
app: 'my-app',
name: 'my-service'
}
await archiveService(data)
FAQs
Serverless Platform SDK
The npm package @serverless/platform-sdk receives a total of 17,214 weekly downloads. As such, @serverless/platform-sdk popularity was classified as popular.
We found that @serverless/platform-sdk 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.