diff --git a/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/__tests__/vpce-policy-service.test.js b/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/__tests__/vpce-policy-service.test.js index 77bdcdd152..6821eb92c8 100644 --- a/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/__tests__/vpce-policy-service.test.js +++ b/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/__tests__/vpce-policy-service.test.js @@ -87,7 +87,7 @@ describe('VPCE Policy Service', () => { let awsAccountsService; let aws; let awsCfnService; - const requestContext = { principalIdentifier: { username: 'sampleUsername' } }; + const requestContext = { principal: { username: 'sampleUsername' } }; const studyEntity = { id: 'sampleBYOBstudyId' }; const projectId = 'sampleProjectId'; const awsAccountId = 'sampleAwsAccountId'; @@ -147,7 +147,7 @@ describe('VPCE Policy Service', () => { // CHECK expect(mockAssumeRole).toHaveBeenCalledWith({ RoleArn: roleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId: externalId, }); }); @@ -157,7 +157,7 @@ describe('VPCE Policy Service', () => { studyService.mustFind = jest.fn().mockReturnValue(projectId); projectService.getAccountForProjectId = jest.fn().mockReturnValue(awsAccountId); awsAccountsService.mustFind = jest.fn().mockReturnValue({ roleArn, externalId }); - requestContext.principalIdentifier.username = undefined; + requestContext.principal.username = undefined; // OPERATE n CHECK await expect(service.getEc2ServiceForStudy(requestContext, studyEntity)).rejects.toThrow(); diff --git a/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/vpce-policy-service.js b/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/vpce-policy-service.js index 7496afe560..2896331bb9 100644 --- a/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/vpce-policy-service.js +++ b/addons/addon-base-raas/packages/base-raas-services/lib/data-source/access-strategy/roles-only/vpce-policy-service.js @@ -49,7 +49,7 @@ class VpcePolicyService extends Service { }); const sts = new this.aws.sdk.STS(); - if (!requestContext.principalIdentifier.username) { + if (!requestContext.principal.username) { throw new Error('Username is required'); } const { @@ -57,7 +57,7 @@ class VpcePolicyService extends Service { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise(); diff --git a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-ec2-environment/start-ec2-environment-sc.js b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-ec2-environment/start-ec2-environment-sc.js index f862c434b2..6aa96b2573 100644 --- a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-ec2-environment/start-ec2-environment-sc.js +++ b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-ec2-environment/start-ec2-environment-sc.js @@ -106,7 +106,7 @@ class StartEc2EnvironmentSc extends StepBase { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise(); diff --git a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-rstudio-environment/start-rstudio-environment-sc.js b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-rstudio-environment/start-rstudio-environment-sc.js index 1826269e50..3239788041 100644 --- a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-rstudio-environment/start-rstudio-environment-sc.js +++ b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-rstudio-environment/start-rstudio-environment-sc.js @@ -110,7 +110,7 @@ class StartRStudioEnvironmentSc extends StepBase { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise(); diff --git a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-sagemaker-environment/start-sagemaker-environment-sc.js b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-sagemaker-environment/start-sagemaker-environment-sc.js index f64138e33d..bc4ff23077 100644 --- a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-sagemaker-environment/start-sagemaker-environment-sc.js +++ b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/start-sagemaker-environment/start-sagemaker-environment-sc.js @@ -112,7 +112,7 @@ class StartSagemakerEnvironmentSc extends StepBase { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise(); diff --git a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-ec2-environment/stop-ec2-environment-sc.js b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-ec2-environment/stop-ec2-environment-sc.js index 6010f8e000..97cd1d110a 100644 --- a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-ec2-environment/stop-ec2-environment-sc.js +++ b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-ec2-environment/stop-ec2-environment-sc.js @@ -110,7 +110,7 @@ class StopEc2EnvironmentSc extends StepBase { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise(); diff --git a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-sagemaker-environment/stop-sagemaker-environment-sc.js b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-sagemaker-environment/stop-sagemaker-environment-sc.js index 21da840d76..dcab1f114d 100644 --- a/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-sagemaker-environment/stop-sagemaker-environment-sc.js +++ b/addons/addon-environment-sc-api/packages/environment-sc-workflow-steps/lib/steps/stop-sagemaker-environment/stop-sagemaker-environment-sc.js @@ -113,7 +113,7 @@ class StopSagemakerEnvironmentSc extends StepBase { } = await sts .assumeRole({ RoleArn, - RoleSessionName: `RaaS-${requestContext.principalIdentifier.username}`, + RoleSessionName: `RaaS-${requestContext.principal.username}`, ExternalId, }) .promise();