Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-cdk/aws-cloudformation

Package Overview
Dependencies
Maintainers
4
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-cdk/aws-cloudformation - npm Package Compare versions

Comparing version 0.14.1 to 0.15.0

4

lib/cloudformation.generated.js

@@ -5,3 +5,3 @@ "use strict";

// See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
// @cfn2ts:meta@ {"generated":"2018-10-26T17:45:17.549Z","fingerprint":"52d/p9NRD80XzI4DPWqVkVrBZS33hXKIftHCuMv7DZQ="}
// @cfn2ts:meta@ {"generated":"2018-11-06T17:07:10.160Z","fingerprint":"EdKUM1F1UNcYCfVZVOPGe3x83VEx8o8+yJ4fFVpWfwc="}
Object.defineProperty(exports, "__esModule", { value: true });

@@ -242,2 +242,2 @@ // tslint:disable:max-line-length | This is generated code - line lengths are difficult to control

})(cloudformation = exports.cloudformation || (exports.cloudformation = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvdWRmb3JtYXRpb24uZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xvdWRmb3JtYXRpb24uZ2VuZXJhdGVkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwrRUFBK0U7QUFDL0UsK0RBQStEO0FBQy9ELDhGQUE4RjtBQUM5RixzSEFBc0g7O0FBRXRILGtHQUFrRztBQUVsRyxvQ0FBcUM7QUFFckMsSUFBaUIsY0FBYyxDQXNFOUI7QUF0RUQsV0FBaUIsY0FBYztJQVkzQjs7Ozs7O09BTUc7SUFDSCxTQUFTLDRCQUE0QixDQUFDLFVBQWU7UUFDakQsSUFBSSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsVUFBVSxDQUFDLEVBQUU7WU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gICAgICogQHBhcmFtIG5hbWUgICAgIHRoZSBuYW1lIG9mIHRoZSByZXNvdXJjZSBpbiB0aGUgYGBjZGsuQ29uc3RydWN0YGAgdHJlZVxuICAgICAgICAgKiBAcGFyYW0gcHJvcGVydGllcyB0aGUgcHJvcGVydGllcyBvZiB0aGlzIGBgV2FpdENvbmRpdGlvbkhhbmRsZVJlc291cmNlYGBcbiAgICAgICAgICovXG4gICAgICAgIGNvbnN0cnVjdG9yKHBhcmVudDogY2RrLkNvbnN0cnVjdCwgbmFtZTogc3RyaW5nKSB7XG4gICAgICAgICAgICBzdXBlcihwYXJlbnQsIG5hbWUsIHsgdHlwZTogV2FpdENvbmRpdGlvbkhhbmRsZVJlc291cmNlLnJlc291cmNlVHlwZU5hbWUgfSk7XG4gICAgICAgICAgICB0aGlzLndhaXRDb25kaXRpb25IYW5kbGVVcmwgPSB0aGlzLnJlZi50b1N0cmluZygpO1xuICAgICAgICB9XG4gICAgfVxufVxuIl19

@@ -40,6 +40,4 @@ "use strict";

});
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addAction('cloudformation:ExecuteChangeSet')
.addResource(stackArnFromName(props.stackName))
.addCondition('StringEquals', { 'cloudformation:ChangeSetName': props.changeSetName }));
SingletonPolicy.forRole(props.stage.pipeline.role)
.grantExecuteChangeSet(props);
}

@@ -69,7 +67,3 @@ }

}
// Allow the pipeline to pass this actions' role to CloudFormation
// Required by all Actions that perform CFN deployments
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addAction('iam:PassRole')
.addResource(this.role.roleArn));
SingletonPolicy.forRole(props.stage.pipeline.role).grantPassRole(this.role);
}

@@ -101,12 +95,3 @@ /**

}
const stackArn = stackArnFromName(props.stackName);
// Allow the pipeline to check for Stack & ChangeSet existence
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addAction('cloudformation:DescribeStacks')
.addResource(stackArn));
// Allow the pipeline to create & delete the specified ChangeSet
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addActions('cloudformation:CreateChangeSet', 'cloudformation:DeleteChangeSet', 'cloudformation:DescribeChangeSet')
.addResource(stackArn)
.addCondition('StringEquals', { 'cloudformation:ChangeSetName': props.changeSetName }));
SingletonPolicy.forRole(props.stage.pipeline.role).grantCreateReplaceChangeSet(props);
}

@@ -139,10 +124,3 @@ }

}
// permissions are based on best-guess from
// https://docs.aws.amazon.com/codepipeline/latest/userguide/how-to-custom-role.html
// and https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awscloudformation.html
const stackArn = stackArnFromName(props.stackName);
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addActions('cloudformation:DescribeStack*', 'cloudformation:CreateStack', 'cloudformation:UpdateStack', 'cloudformation:DeleteStack', // needed when props.replaceOnFailure is true
'cloudformation:GetTemplate*', 'cloudformation:ValidateTemplate', 'cloudformation:GetStackPolicy', 'cloudformation:SetStackPolicy')
.addResource(stackArn));
SingletonPolicy.forRole(props.stage.pipeline.role).grantCreateUpdateStack(props);
}

@@ -162,6 +140,3 @@ }

});
const stackArn = stackArnFromName(props.stackName);
props.stage.pipelineRole.addToPolicy(new iam.PolicyStatement()
.addActions('cloudformation:DescribeStack*', 'cloudformation:DeleteStack')
.addResource(stackArn));
SingletonPolicy.forRole(props.stage.pipeline.role).grantDeleteStack(props);
}

@@ -198,2 +173,102 @@ }

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZWxpbmUtYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBpcGVsaW5lLWFjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw4REFBZ0U7QUFDaEUsd0NBQXlDO0FBQ3pDLG9DQUFxQztBQW1DckM7O0dBRUc7QUFDSCxNQUFzQiw0QkFBNkIsU0FBUSxZQUFZLENBQUMsTUFBTTtJQVE1RSxZQUFZLE1BQXFCLEVBQUUsRU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5Gcm9tTmFtZShzdGFja05hbWU6IHN0cmluZyk6IHN0cmluZyB7XG4gIHJldHVybiBjZGsuQXJuVXRpbHMuZnJvbUNvbXBvbmVudHMoe1xuICAgIHNlcnZpY2U6ICdjbG91ZGZvcm1hdGlvbicsXG4gICAgcmVzb3VyY2U6ICdzdGFjaycsXG4gICAgcmVzb3VyY2VOYW1lOiBgJHtzdGFja05hbWV9LypgXG4gIH0pO1xufVxuIl19
/**
* Manages a bunch of singleton-y statements on the policy of an IAM Role.
* Dedicated methods can be used to add specific permissions to the role policy
* using as few statements as possible (adding resources to existing compatible
* statements instead of adding new statements whenever possible).
*
* Statements created outside of this class are not considered when adding new
* permissions.
*/
class SingletonPolicy extends cdk.Construct {
constructor(role) {
super(role, SingletonPolicy.UUID);
this.role = role;
this.statements = {};
}
/**
* Obtain a SingletonPolicy for a given role.
* @param role the Role this policy is bound to.
* @returns the SingletonPolicy for this role.
*/
static forRole(role) {
const found = role.tryFindChild(SingletonPolicy.UUID);
return found || new SingletonPolicy(role);
}
grantCreateUpdateStack(props) {
const actions = [
'cloudformation:DescribeStack*',
'cloudformation:CreateStack',
'cloudformation:UpdateStack',
'cloudformation:GetTemplate*',
'cloudformation:ValidateTemplate',
'cloudformation:GetStackPolicy',
'cloudformation:SetStackPolicy',
];
if (props.replaceOnFailure) {
actions.push('cloudformation:DeleteStack');
}
this.statementFor({ actions }).addResource(stackArnFromName(props.stackName));
}
grantCreateReplaceChangeSet(props) {
this.statementFor({
actions: [
'cloudformation:CreateChangeSet',
'cloudformation:DeleteChangeSet',
'cloudformation:DescribeChangeSet',
'cloudformation:DescribeStacks',
],
conditions: { StringEqualsIfExists: { 'cloudformation:ChangeSetName': props.changeSetName } },
}).addResource(stackArnFromName(props.stackName));
}
grantExecuteChangeSet(props) {
this.statementFor({
actions: ['cloudformation:ExecuteChangeSet'],
conditions: { StringEquals: { 'cloudformation:ChangeSetName': props.changeSetName } },
}).addResource(stackArnFromName(props.stackName));
}
grantDeleteStack(props) {
this.statementFor({
actions: [
'cloudformation:DescribeStack*',
'cloudformation:DeleteStack',
]
}).addResource(stackArnFromName(props.stackName));
}
grantPassRole(role) {
this.statementFor({ actions: ['iam:PassRole'] }).addResource(role.roleArn);
}
statementFor(template) {
const key = keyFor(template);
if (!(key in this.statements)) {
this.statements[key] = new iam.PolicyStatement().addActions(...template.actions);
if (template.conditions) {
this.statements[key].addConditions(template.conditions);
}
this.role.addToPolicy(this.statements[key]);
}
return this.statements[key];
function keyFor(props) {
const actions = `${props.actions.sort().join('\x1F')}`;
const conditions = formatConditions(props.conditions);
return `${actions}\x1D${conditions}`;
function formatConditions(cond) {
if (cond == null) {
return '';
}
let result = '';
for (const op of Object.keys(cond).sort()) {
result += `${op}\x1E`;
const condition = cond[op];
for (const attribute of Object.keys(condition).sort()) {
const value = condition[attribute];
result += `${value}\x1F`;
}
}
return result;
}
}
}
}
SingletonPolicy.UUID = '8389e75f-0810-4838-bf64-d6f85a95cf83';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGlwZWxpbmUtYWN0aW9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBpcGVsaW5lLWFjdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSw4REFBZ0U7QUFDaEUsd0NBQXlDO0FBQ3pDLG9DQUFxQztBQW1DckM7O0dBRUc7QUFDSCxNQUFzQiw0QkFBNkIsU0FBUSxZQUFZLENBQUMsTUFBTTtJQVE1RSxZQUFZLE1BQXFCLEVBQUUsRUFBVSxFQUFFLEtBQXdDLEVBQUUsYUFBbUI7UUFDMUcsS0FBSyxDQUFDLE1BQU0sRUFBRSxFQUFFLEVBQUU7WUFDaEIsS0FBSyxFQUFFLEtBQUssQ0FBQyxLQUFLO1lBQ2xCLFFBQVEsRUFBRSxLQUFLLENBQUMsUUFBUTtZQUN4QixjQUFjLEVBQUU7Z0JBQ2QsU0FBUyxFQUF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aWJ1dGVdO1xuICAgICAgICAgICAgcmVzdWx0ICs9IGAke3ZhbHVlfVxceDFGYDtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cblxuaW50ZXJmYWNlIFN0YXRlbWVudFRlbXBsYXRlIHtcbiAgYWN0aW9uczogc3RyaW5nW107XG4gIGNvbmRpdGlvbnM/OiBTdGF0ZW1lbnRDb25kaXRpb247XG59XG5cbnR5cGUgU3RhdGVtZW50Q29uZGl0aW9uID0geyBbb3A6IHN0cmluZ106IHsgW2F0dHJpYnV0ZTogc3RyaW5nXTogc3RyaW5nIH0gfTtcbiJdfQ==
{
"name": "@aws-cdk/aws-cloudformation",
"version": "0.14.1",
"version": "0.15.0",
"description": "CDK Constructs for AWS CloudFormation",

@@ -59,11 +59,20 @@ "main": "lib/index.js",

"devDependencies": {
"@aws-cdk/assert": "^0.14.1",
"@aws-cdk/assert": "^0.15.0",
"@aws-cdk/aws-events": "^0.15.0",
"@types/lodash": "^4.14.116",
"cdk-build-tools": "^0.14.1",
"cdk-integ-tools": "^0.14.1",
"cfn2ts": "^0.14.1",
"cdk-build-tools": "^0.15.0",
"cdk-integ-tools": "^0.15.0",
"cfn2ts": "^0.15.0",
"lodash": "^4.17.11",
"pkglint": "^0.14.1"
"pkglint": "^0.15.0"
},
"dependencies": {
"@aws-cdk/aws-codepipeline-api": "^0.15.0",
"@aws-cdk/aws-iam": "^0.15.0",
"@aws-cdk/aws-lambda": "^0.15.0",
"@aws-cdk/aws-sns": "^0.15.0",
"@aws-cdk/cdk": "^0.15.0"
},
"homepage": "https://github.com/awslabs/aws-cdk",
"peerDependencies": {
"@aws-cdk/aws-codepipeline-api": "^0.14.1",

@@ -74,4 +83,3 @@ "@aws-cdk/aws-iam": "^0.14.1",

"@aws-cdk/cdk": "^0.14.1"
},
"homepage": "https://github.com/awslabs/aws-cdk"
}
}

@@ -44,4 +44,5 @@ "use strict";

: '';
const statementsStr = JSON.stringify(cdk.resolve(statements), null, 2);
test.ok(_grantsPermission(statements, action, resource, conditions), `Expected to find a statement granting ${action} on ${JSON.stringify(cdk.resolve(resource))}${conditionStr}, found:\n${statementsStr}`);
const resolvedStatements = cdk.resolve(statements);
const statementsStr = JSON.stringify(resolvedStatements, null, 2);
test.ok(_grantsPermission(resolvedStatements, action, resource, conditions), `Expected to find a statement granting ${action} on ${JSON.stringify(cdk.resolve(resource))}${conditionStr}, found:\n${statementsStr}`);
}

@@ -86,16 +87,27 @@ function _grantsPermission(statements, action, resource, conditions) {

}
class PipelineDouble {
constructor({ pipelineName, role }) {
this.pipelineArn = cdk.ArnUtils.fromComponents({ service: 'codepipeline', resource: 'pipeline', resourceName: pipelineName || 'TestPipeline' });
this.role = role;
}
get uniqueId() {
throw new Error("Unsupported");
}
grantBucketRead() {
throw new Error("Unsupported");
}
grantBucketReadWrite() {
throw new Error("Unsupported");
}
asEventRuleTarget() {
throw new Error("Unsupported");
}
}
class StageDouble {
constructor({ name, pipelineName, pipelineRole }) {
constructor({ name, pipeline }) {
this._internal = this;
this.actions = new Array();
this.name = name || 'TestStage';
this.pipelineArn = cdk.ArnUtils.fromComponents({ service: 'codepipeline', resource: 'pipeline', resourceName: pipelineName || 'TestPipeline' });
this.pipelineRole = pipelineRole;
this.pipeline = pipeline;
}
grantPipelineBucketRead() {
throw new Error('Unsupported');
}
grantPipelineBucketReadWrite() {
throw new Error('Unsupported');
}
_attachAction(action) {

@@ -118,3 +130,3 @@ this.actions.push(action);

super.addToPolicy(statement);
this.statements.push(statement.toJson());
this.statements.push(statement);
}

@@ -124,6 +136,6 @@ }

'CreateReplaceChangeSet': {
works(test) {
'works'(test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const stage = new StageDouble({ pipelineRole });
const stage = new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) });
const artifact = new cpapi.Artifact(stack, 'TestArtifact');

@@ -138,4 +150,4 @@ const action = new cloudformation.PipelineCreateReplaceChangeSetAction(stack, 'Action', {

const stackArn = _stackArn('MyStack');
const changeSetCondition = { StringEquals: { 'cloudformation:ChangeSetName': 'MyChangeSet' } };
_assertPermissionGranted(test, pipelineRole.statements, 'cloudformation:DescribeStacks', stackArn);
const changeSetCondition = { StringEqualsIfExists: { 'cloudformation:ChangeSetName': 'MyChangeSet' } };
_assertPermissionGranted(test, pipelineRole.statements, 'cloudformation:DescribeStacks', stackArn, changeSetCondition);
_assertPermissionGranted(test, pipelineRole.statements, 'cloudformation:DescribeChangeSet', stackArn, changeSetCondition);

@@ -151,9 +163,54 @@ _assertPermissionGranted(test, pipelineRole.statements, 'cloudformation:CreateChangeSet', stackArn, changeSetCondition);

test.done();
},
'uses a single permission statement if the same ChangeSet name is used'(test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const stage = new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) });
const artifact = new cpapi.Artifact(stack, 'TestArtifact');
new cloudformation.PipelineCreateReplaceChangeSetAction(stack, 'ActionA', {
stage,
changeSetName: 'MyChangeSet',
stackName: 'StackA',
templatePath: artifact.atPath('path/to/file')
});
new cloudformation.PipelineCreateReplaceChangeSetAction(stack, 'ActionB', {
stage,
changeSetName: 'MyChangeSet',
stackName: 'StackB',
templatePath: artifact.atPath('path/to/other/file')
});
test.deepEqual(cdk.resolve(pipelineRole.statements), [
{
Action: 'iam:PassRole',
Effect: 'Allow',
Resource: [
{ 'Fn::GetAtt': ['ActionARole72759154', 'Arn'] },
{ 'Fn::GetAtt': ['ActionBRole6A2F6804', 'Arn'] }
],
},
{
Action: [
'cloudformation:CreateChangeSet',
'cloudformation:DeleteChangeSet',
'cloudformation:DescribeChangeSet',
'cloudformation:DescribeStacks'
],
Condition: { StringEqualsIfExists: { 'cloudformation:ChangeSetName': 'MyChangeSet' } },
Effect: 'Allow',
Resource: [
// tslint:disable-next-line:max-line-length
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':cloudformation:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':stack/StackA/*']] },
// tslint:disable-next-line:max-line-length
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':cloudformation:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':stack/StackB/*']] }
],
}
]);
test.done();
}
},
'ExecuteChangeSet': {
works(test) {
'works'(test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const stage = new StageDouble({ pipelineRole });
const stage = new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) });
new cloudformation.PipelineExecuteChangeSetAction(stack, 'Action', {

@@ -172,2 +229,31 @@ stage,

test.done();
},
'uses a single permission statement if the same ChangeSet name is used'(test) {
const stack = new cdk.Stack();
const pipelineRole = new RoleDouble(stack, 'PipelineRole');
const stage = new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) });
new cloudformation.PipelineExecuteChangeSetAction(stack, 'ActionA', {
stage,
changeSetName: 'MyChangeSet',
stackName: 'StackA',
});
new cloudformation.PipelineExecuteChangeSetAction(stack, 'ActionB', {
stage,
changeSetName: 'MyChangeSet',
stackName: 'StackB',
});
test.deepEqual(cdk.resolve(pipelineRole.statements), [
{
Action: 'cloudformation:ExecuteChangeSet',
Condition: { StringEquals: { 'cloudformation:ChangeSetName': 'MyChangeSet' } },
Effect: 'Allow',
Resource: [
// tslint:disable-next-line:max-line-length
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':cloudformation:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':stack/StackA/*']] },
// tslint:disable-next-line:max-line-length
{ 'Fn::Join': ['', ['arn:', { Ref: 'AWS::Partition' }, ':cloudformation:', { Ref: 'AWS::Region' }, ':', { Ref: 'AWS::AccountId' }, ':stack/StackB/*']] }
],
}
]);
test.done();
}

@@ -179,5 +265,6 @@ },

const action = new cloudformation.PipelineCreateUpdateStackAction(stack, 'Action', {
stage: new StageDouble({ pipelineRole }),
stage: new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) }),
templatePath: new cpapi.Artifact(stack, 'TestArtifact').atPath('some/file'),
stackName: 'MyStack',
replaceOnFailure: true,
});

@@ -196,3 +283,3 @@ const stackArn = _stackArn('MyStack');

const action = new cloudformation.PipelineDeleteStackAction(stack, 'Action', {
stage: new StageDouble({ pipelineRole }),
stage: new StageDouble({ pipeline: new PipelineDouble({ role: pipelineRole }) }),
stackName: 'MyStack',

@@ -207,2 +294,2 @@ });

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5waXBlbGluZS1hY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsidGVzdC5waXBlbGluZS1hY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSx1REFBd0Q7QUFDeEQsd0NBQXlDO0FBQ3pDLG9DQUFxQztBQUNyQyw0QkFBNkI7QUFDN0IscUNBQXNDO0FBQ3RDLHlDQUEwQztBQTJHMUMsU0FBUyxvQkFBb0IsQ0FBQyxJQUFtQixFQUNuQixPQUF1QixFQUN2QixLQUFhLEVBQ2IsUUFBZ0IsRUFDaEIsUUFBZ0IsRUFDaEIsYUFBc0M7SUFDbEUsTUFBTSxnQkFBZ0IsR0FBRyxhQUFhO1FBQ2YsQ0FBQyxDQUFDLDJCQUEyQixJQUFJLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQyxFQUFFO1FBQ2xGLENBQUMsQ0FBQyxFQUFFLENBQUM7SUFDNUIsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQ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Epzb24ge1xuICBFZmZlY3Q6ICdBbGxvdycgfCAnRGVueSc7XG4gIEFjdGlvbjogc3RyaW5nIHwgc3RyaW5nW107XG4gIFJlc291cmNlOiBzdHJpbmcgfMKgc3RyaW5nW107XG4gIENvbmRpdGlvbjogYW55O1xufVxuXG5mdW5jdGlvbiBfYXNzZXJ0QWN0aW9uTWF0Y2hlcyh0ZXN0OiBub2RldW5pdC5UZXN0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uczogY3BhcGkuQWN0aW9uW10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvd25lcjogc3RyaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvdmlkZXI6IHN0cmluZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5OiBzdHJpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uPzogeyBba2V5OiBzdHJpbmddOiBhbnkgfSkge1xuICBjb25zdCBjb25maWd1cmF0aW9uU3RyID0gY29uZmlndXJhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgID8gYGNvbmZpZ3VyYXRpb24gaW5jbHVkaW5nICR7SlNPTi5zdHJpbmdpZnkoY2RrLnJlc29sdmUoY29uZmlndXJhdGlvbiksIG51bGwsIDIpfWBcbiAgICAgICAgICAgICAgICAgICAgICAgICA6ICcnO1xuICBjb25zdCBhY3Rpb25zU3RyID0gSlNPTi5zdHJpbmdpZnkoYWN0aW9ucy5tYXAoYSA9PlxuICAgICh7IG93bmVyOiBhLm93bmVyLCBwcm92aWRlcjogYS5wcm92aWRlciwgY2F0ZWdvcnk6IGEuY2F0ZWdvcnksIGNvbmZpZ3VyYXRpb246IGNkay5yZXNvbHZlKGEuY29uZmlndXJhdGlvbikgfSlcbiAgKSwgbnVsbCwgMik7XG4gIHRlc3Qub2soX2hhc0FjdGlvbihhY3Rpb25zLCBvd25lciwgcHJvdmlkZX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iAgcHVibGljIHJlYWRvbmx5IHN0YXRlbWVudHMgPSBuZXcgQXJyYXk8aWFtLlBvbGljeVN0YXRlbWVudD4oKTtcblxuICBjb25zdHJ1Y3RvcihwYXJlbnQ6IGNkay5Db25zdHJ1Y3QsIGlkOiBzdHJpbmcsIHByb3BzOiBpYW0uUm9sZVByb3BzID0geyBhc3N1bWVkQnk6IG5ldyBpYW0uU2VydmljZVByaW5jaXBhbCgndGVzdCcpIH0pIHtcbiAgICBzdXBlcihwYXJlbnQsIGlkLCBwcm9wcyk7XG4gIH1cblxuICBwdWJsaWMgYWRkVG9Qb2xpY3koc3RhdGVtZW50OiBpYW0uUG9saWN5U3RhdGVtZW50KSB7XG4gICAgc3VwZXIuYWRkVG9Qb2xpY3koc3RhdGVtZW50KTtcbiAgICB0aGlzLnN0YXRlbWVudHMucHVzaChzdGF0ZW1lbnQpO1xuICB9XG59XG4iXX0=

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc