
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@aws-cdk/assert
Advanced tools
The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
This library contains helpers for writing unit tests and integration tests for CDK libraries
Write your unit tests like this:
const stack = new Stack();
new MyConstruct(stack, 'MyConstruct', {
...
});
expect(stack).to(someExpectation(...));
Here are the expectations you can use:
Check that the synthesized stack template looks like the given template, or is a superset of it. These functions match logical IDs and all properties of a resource.
matchTemplate(template, matchStyle)
exactlyMatchTemplate(template)
beASupersetOfTemplate(template)
Example:
expect(stack).to(beASupersetOfTemplate({
Resources: {
HostedZone674DD2B7: {
Type: "AWS::Route53::HostedZone",
Properties: {
Name: "test.private.",
VPCs: [{
VPCId: { Ref: 'VPC06C5F037' },
VPCRegion: { Ref: 'AWS::Region' }
}]
}
}
}
}));
If you only care that a resource of a particular type exists (regardless of its logical identifier), and that some of its properties are set to specific values:
haveResource(type, subsetOfProperties)
Example:
expect(stack).to(haveResource('AWS::CertificateManager::Certificate', {
DomainName: 'test.example.com',
// Note: some properties omitted here
ShouldNotExist: ABSENT
}));
ABSENT
is a magic value to assert that a particular key in an object is not set (or set to undefined
).
If you want to assert that n
number of resources of a particular type exist, with or without specific properties:
countResources(type, count)
countResourcesLike(type, count, props)
Example:
expect(stack).to(countResources('AWS::ApiGateway::Method', 3));
expect(stack).to(countResourcesLike('AWS::ApiGateway::Method', 1, {
HttpMethod: 'GET',
ResourceId: {
"Ref": "MyResource01234"
}
}));
haveOutput
assertion can be used to check that a stack contains specific output.
Parameters to check against can be:
outputName
outputValue
exportName
If outputValue
is provided, at least one of outputName
, exportName
should be provided as well
Example
expect(synthStack).to(haveOutput({
outputName: 'TestOutputName',
exportName: 'TestOutputExportName',
outputValue: {
'Fn::GetAtt': [
'TestResource',
'Arn'
]
}
}));
1.33.0 (2020-04-17)
grantRead()
API no longer provides permissions to kinesis:DescribeStream
as it provides permissions to kinesis:DescribeStreamSummary
and kinesis:SubscribeToShard
in it's place. If it's still desired, it can be added through the grant()
API on the stream.grantWrite()
API no longer has DescribeStream
permissions as it has been replaced by ListShards
for shard discoverybottlerocket
capacity. (e9f691f), closes #7268grantRead
now allows the ListShards
action and grant
is now public (#6141) (563fba4), closes #3357grant
API to IStream to add permissions to a Stream (#7354) (c223406)aws-kinesis
module is now stable (#7349) (4ab3ffa), closes #5874=
symbols get truncated (#7226) (b7ddf5b), closes #7246FAQs
An assertion library for use with CDK Apps
The npm package @aws-cdk/assert receives a total of 77,310 weekly downloads. As such, @aws-cdk/assert popularity was classified as popular.
We found that @aws-cdk/assert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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 uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.