Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A Python library with convenience helpers for working with the AWS Serverless Application Repository.
A Python library with convenience helpers for working with the AWS Serverless Application Repository.
Simply use pip to install the library:
pip install serverlessrepo
The serverlessrepo module provides a simple interface for publishing applications and managing application permissions. To get started, import the serverlessrepo module:
import serverlessrepo
Given an AWS Serverless Application Model (SAM) template, it publishes a new application using the specified metadata in AWS Serverless Application Repository. If the application already exists, it updates metadata of the application and publishes a new version if specified in the template.
For example:
import boto3
import yaml
from serverlessrepo import publish_application
sar_client = boto3.client('serverlessrepo', region_name='us-east-1')
with open('template.yaml', 'r') as f:
template = f.read()
# if sar_client is not provided, we will initiate the client using region inferred from aws configurations
output = publish_application(template, sar_client)
# Alternatively, pass parsed template as a dictionary
template_dict = yaml.loads(template)
output = publish_application(template_dict, sar_client)
The output of publish_application
has the following structure:
{
'application_id': 'arn:aws:serverlessrepo:us-east-1:123456789012:applications/test-app',
'actions': ['CREATE_APPLICATION'],
'details': {
'Author': 'user1',
'Description': 'hello',
'Name': 'hello-world',
'SemanticVersion': '0.0.1',
'SourceCodeUrl': 'https://github.com/hello'}
}
}
There are three possible values for the actions
field:
['CREATE_APPLICATION']
- Created a new application.['UPDATE_APPLICATION']
- Updated metadata of an existing application.['UPDATE_APPLICATION', 'CREATE_APPLICATION_VERSION']
- Updated metadata of an existing application and created a new version, only applicable if a new SemanticVersion is provided in the input template.details
has different meaning based on the actions
taken:
Parses the application metadata from the SAM template and only updates the metadata.
For example:
import boto3
import yaml
from serverlessrepo import update_application_metadata
sar_client = boto3.client('serverlessrepo', region_name='us-east-1')
with open('template.yaml', 'r') as f:
template = f.read()
application_id = 'arn:aws:serverlessrepo:us-east-1:123456789012:applications/test-app'
# if sar_client is not provided, we will initiate the client using region inferred from aws configurations
update_application_metadata(template, application_id, sar_client)
# Alternatively, pass parsed template as a dictionary
template_dict = yaml.loads(template)
update_application_metadata(template_dict, application_id, sar_client)
Makes an application public so that it's visible to everyone.
Makes an application private so that it's only visible to the owner.
Shares the application with specified AWS accounts.
import boto3
from serverlessrepo import (
make_application_public,
make_application_private,
share_application_with_accounts
)
application_id = 'arn:aws:serverlessrepo:us-east-1:123456789012:applications/test-app'
sar_client = boto3.client('serverlessrepo', region_name='us-east-1')
# Share an application publicly
make_application_public(application_id, sar_client)
# Make an application private
make_application_private(application_id, sar_client)
# Share an application with other AWS accounts
share_application_with_accounts(application_id, ['123456789013', '123456789014'], sar_client)
git clone https://github.com/<username>/aws-serverlessrepo-python.git
make init
pipenv install [package names]
make build
make test
separately to verify that tests pass.make flake
and make lint
.make pr
This library is licensed under the Apache 2.0 License.
FAQs
A Python library with convenience helpers for working with the AWS Serverless Application Repository.
We found that serverlessrepo demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.