Commit ed9f1e06 authored by Varunkumar Manohar's avatar Varunkumar Manohar
Browse files

Merge branch 'slb/vm/parallelizedeops' into 'master'

perf: optimize DE create group and user addition calls

See merge request !166
parents 7ab56475 3ffd2e94
Pipeline #58115 failed with stages
in 11 minutes and 11 seconds
......@@ -130,12 +130,14 @@ export class SubProjectHandler {
if (FeatureFlags.isEnabled(Feature.AUTHORIZATION)) {
// provision new groups
await AuthGroups.createGroup(userToken, adminGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' admin group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]);
await AuthGroups.createGroup(userToken, viewerGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' editor group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]);
await Promise.all([
AuthGroups.createGroup(userToken, adminGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' admin group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]),
AuthGroups.createGroup(userToken, viewerGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' editor group',
tenant.esd, req[Config.DE_FORWARD_APPKEY])]
);
}
subproject.gcs_bucket = await this.getBucketName(tenant);
......@@ -163,11 +165,12 @@ export class SubProjectHandler {
// if admin is not the requestor, assign the admin and rm the requestor, has to be a sequential op
if (subprojectCreatorEmail !== userEmail) {
await AuthGroups.addUserToGroup(userToken, adminGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true);
await AuthGroups.addUserToGroup(userToken, viewerGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true);
await Promise.all([
AuthGroups.addUserToGroup(userToken, adminGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true),
AuthGroups.addUserToGroup(userToken, viewerGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true)
]);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment