Skip to content

Commit

Permalink
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
.DS_Store
node_modules
lerna-debug.log
15 changes: 14 additions & 1 deletion packages/aws-cdk/test/cloudformation/test.perms.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Test } from 'nodeunit';
import { FnConcat, PolicyDocument, PolicyStatement, resolve } from '../../lib';
import { CanonicalUserPrincipal, FnConcat, PolicyDocument, PolicyStatement, resolve } from '../../lib';

export = {
'the Permission class is a programming model for iam'(test: Test) {
@@ -91,6 +91,19 @@ export = {
test.done();
},

'canonicalUserPrincipal adds a principal to a policy with the passed canonical user id'(test: Test) {
const p = new PolicyStatement();
const canoncialUser = "averysuperduperlongstringfor";
p.addPrincipal(new CanonicalUserPrincipal(canoncialUser));
test.deepEqual(resolve(p), {
Effect: "Allow",
Principal: {
CanonicalUser: canoncialUser
}
});
test.done();
},

'addAccountRootPrincipal adds a principal with the current account root'(test: Test) {
const p = new PolicyStatement();
p.addAccountRootPrincipal();

0 comments on commit f02c2c5

Please sign in to comment.