Skip to content

Commit cf342cc

Browse files
authored
chore: ref auth e2e test updates (#2346)
* fix: add required pb to ref auth e2e test * chore: add changeset
1 parent 07fe7d4 commit cf342cc

File tree

4 files changed

+49
-37
lines changed

4 files changed

+49
-37
lines changed

.changeset/plenty-mugs-learn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

package-lock.json

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/integration-tests/src/resource-creation/auth_resource_creator.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,16 @@ export class AuthResourceCreator {
277277
setupUserPoolGroup = async (
278278
groupName: string,
279279
userPoolId: string,
280-
identityPoolId: string
280+
identityPoolId: string,
281+
permissionBoundaryArn: string
281282
) => {
282283
const groupRole = await this.createRoleBase({
283284
RoleName: 'ref-auth-group-role',
284285
AssumeRolePolicyDocument: this.getIdentityPoolAssumeRolePolicyDocument(
285286
identityPoolId,
286287
'authenticated'
287288
),
289+
PermissionsBoundary: permissionBoundaryArn,
288290
});
289291
const group = await this.createUserPoolGroupBase({
290292
GroupName: groupName,
@@ -304,21 +306,24 @@ export class AuthResourceCreator {
304306
setupIdentityPoolRoles = async (
305307
userPoolId: string,
306308
userPoolClientId: string,
307-
identityPoolId: string
309+
identityPoolId: string,
310+
permissionBoundaryArn: string
308311
) => {
309312
const authRole = await this.createRoleBase({
310313
RoleName: `ref-auth-role`,
311314
AssumeRolePolicyDocument: this.getIdentityPoolAssumeRolePolicyDocument(
312315
identityPoolId,
313316
'authenticated'
314317
),
318+
PermissionsBoundary: permissionBoundaryArn,
315319
});
316320
const unauthRole = await this.createRoleBase({
317321
RoleName: `ref-unauth-role`,
318322
AssumeRolePolicyDocument: this.getIdentityPoolAssumeRolePolicyDocument(
319323
identityPoolId,
320324
'unauthenticated'
321325
),
326+
PermissionsBoundary: permissionBoundaryArn,
322327
});
323328
const region = await this.cognitoIdentityClient.config.region();
324329
await this.cognitoIdentityClient.send(

packages/integration-tests/src/test-project-setup/reference_auth_project.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ class ReferenceAuthTestProject extends TestProjectBase {
183183
DeletionProtection: 'INACTIVE',
184184
});
185185

186+
const accountId = userPool.Arn!.split(':')[4]; // arn:aws:cognito-idp:<region>:<account>:userpool/<userpoolid>
187+
const permissionBoundaryArn = `arn:aws:iam::${accountId}:policy/CreateRolePermissionBoundaryPolicy`;
188+
186189
const domain = await this.authResourceCreator.createUserPoolDomainBase({
187190
UserPoolId: userPool.Id,
188191
Domain: `ref-auth`,
@@ -307,13 +310,15 @@ class ReferenceAuthTestProject extends TestProjectBase {
307310
const roles = await this.authResourceCreator.setupIdentityPoolRoles(
308311
userPool.Id!,
309312
userPoolClient.ClientId!,
310-
identityPool.IdentityPoolId
313+
identityPool.IdentityPoolId,
314+
permissionBoundaryArn
311315
);
312316

313317
const adminGroup = await this.authResourceCreator.setupUserPoolGroup(
314318
'ADMINS',
315319
userPool.Id!,
316-
identityPool.IdentityPoolId
320+
identityPool.IdentityPoolId,
321+
permissionBoundaryArn
317322
);
318323
return {
319324
userPool,

0 commit comments

Comments
 (0)