Commit a4f50735 authored by Daniel Perez's avatar Daniel Perez
Browse files

Merge branch 'master' into slb/dperez50/swagger

parents 033f649c 62a9c102
Pipeline #34845 passed with stages
in 9 minutes and 54 seconds
......@@ -43,12 +43,12 @@ npm run code-coverage
--run-parallel
# run the linter on sources
tslint -c tslint.json 'src/**/*.ts'
tslint -c tslint.json -p tsconfig.json 'src/**/*.ts'
```
## Environment configuration
Environment variables can be provided with a `.env` file in the root of the project to be consumed
by [dotenv](https://github.com/motdotla/dotenv). Environment variables are [preloaded](https://github.com/motdotla/dotenv#preload)
by the `npm start` command with the argument `-r dotenv/config`. A template `.env` file can be found
by the `npm start` command with the argument `-r dotenv/config`. A template `.env` file can be found
in `/docs/templates/.env-sample`.
......@@ -11,8 +11,7 @@ aws-test-newman:
- apt-get install -y python
- apt-get install -y python-pip
- pip install -r devops/aws/requirements.txt
- svctoken=$(python devops/scripts/aws_jwt_client.py)
- echo $svctoken
- svctoken=$(python devops/scripts/aws_jwt_client.py)
- npm install -g newman
- chmod +x ./tests/e2e/run_e2e_tests.sh
- ./tests/e2e/run_e2e_tests.sh --seistore-svc-url=${SEISMICSTORE_SVC_URL} --seistore-svc-api-key="NA" --user-idtoken="$svctoken" --user-idtoken="$svctoken" --tenant=opendes --subproject=awsdemosubproject --admin-email="${AWS_COGNITO_AUTH_PARAMS_USER}" --datapartition=opendes --legaltag01=opendes-sdmstestlegaltag --legaltag02=opendes-sdmstestlegaltag --subproject-long-name=subprojectlonggggggggggggggggggggggname --VCS-Provider="${ISGITLAB}"
......
......@@ -865,6 +865,11 @@
"extend": "^3.0.2"
}
},
"@google-cloud/precise-date": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/@google-cloud/precise-date/-/precise-date-2.0.3.tgz",
"integrity": "sha512-+SDJ3ZvGkF7hzo6BGa8ZqeK3F6Z4+S+KviC9oOK+XCs3tfMyJCh/4j93XIWINgMMDIh9BgEvlw4306VxlXIlYA=="
},
"@google-cloud/projectify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-2.0.1.tgz",
......@@ -875,6 +880,117 @@
"resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-2.0.3.tgz",
"integrity": "sha512-d4VSA86eL/AFTe5xtyZX+ePUjE8dIFu2T8zmdeNBSa5/kNgXPCx/o/wbFNHAGLJdGnk1vddRuMESD9HbOC8irw=="
},
"@google-cloud/pubsub": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-2.10.0.tgz",
"integrity": "sha512-XM/Fc6/W/LYzGH2pnhGLDR5E6JNZFMfzyUFP5bWgC4FK1KqIZ4g6hrnCCO38G4JfH2i1IuSQuefPF7FrZZo9tw==",
"requires": {
"@google-cloud/paginator": "^3.0.0",
"@google-cloud/precise-date": "^2.0.0",
"@google-cloud/projectify": "^2.0.0",
"@google-cloud/promisify": "^2.0.0",
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/tracing": "^0.12.0",
"@types/duplexify": "^3.6.0",
"@types/long": "^4.0.0",
"arrify": "^2.0.0",
"extend": "^3.0.2",
"google-auth-library": "^7.0.0",
"google-gax": "^2.9.2",
"is-stream-ended": "^0.1.4",
"lodash.snakecase": "^4.1.1",
"p-defer": "^3.0.0"
},
"dependencies": {
"@opentelemetry/api": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.12.0.tgz",
"integrity": "sha512-Dn4vU5GlaBrIWzLpsM6xbJwKHdlpwBQ4Bd+cL9ofJP3hKT8jBXpBpribmyaqAzrajzzl2Yt8uTa9rFVLfjDAvw==",
"requires": {
"@opentelemetry/context-base": "^0.12.0"
}
},
"@opentelemetry/context-base": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.12.0.tgz",
"integrity": "sha512-UXwSsXo3F3yZ1dIBOG9ID8v2r9e+bqLWoizCtTb8rXtwF+N5TM7hzzvQz72o3nBU+zrI/D5e+OqAYK8ZgDd3DA=="
},
"gaxios": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.2.0.tgz",
"integrity": "sha512-Ms7fNifGv0XVU+6eIyL9LB7RVESeML9+cMvkwGS70xyD6w2Z80wl6RiqiJ9k1KFlJCUTQqFFc8tXmPQfSKUe8g==",
"requires": {
"abort-controller": "^3.0.0",
"extend": "^3.0.2",
"https-proxy-agent": "^5.0.0",
"is-stream": "^2.0.0",
"node-fetch": "^2.3.0"
}
},
"gcp-metadata": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz",
"integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==",
"requires": {
"gaxios": "^4.0.0",
"json-bigint": "^1.0.0"
}
},
"google-auth-library": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-7.0.3.tgz",
"integrity": "sha512-6wJNYqY1QUr5I2lWaUkkzOT2b9OCNhNQrdFOt/bsBbGb7T7NCdEvrBsXraUm+KTUGk2xGlQ7m9RgUd4Llcw8NQ==",
"requires": {
"arrify": "^2.0.0",
"base64-js": "^1.3.0",
"ecdsa-sig-formatter": "^1.0.11",
"fast-text-encoding": "^1.0.0",
"gaxios": "^4.0.0",
"gcp-metadata": "^4.2.0",
"gtoken": "^5.0.4",
"jws": "^4.0.0",
"lru-cache": "^6.0.0"
}
},
"is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
},
"jwa": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
"integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
"requires": {
"buffer-equal-constant-time": "1.0.1",
"ecdsa-sig-formatter": "1.0.11",
"safe-buffer": "^5.0.1"
}
},
"jws": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
"requires": {
"jwa": "^2.0.0",
"safe-buffer": "^5.0.1"
}
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"@google-cloud/storage": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/@google-cloud/storage/-/storage-5.7.0.tgz",
......@@ -1509,6 +1625,108 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.6.1.tgz",
"integrity": "sha512-5bHhlTBBq82ti3qPT15TRxkYTFPPQWbnkkQkmHPtqiS1XcTB69cEKd3Jm7Cfi/vkPoyxapmePE9tyA7EzLt8SQ=="
},
"@opentelemetry/core": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-0.12.0.tgz",
"integrity": "sha512-oLZIkmTNWTJXzo1eA4dGu/S7wOVtylsgnEsCmhSJGhrJVDXm1eW/aGuNs3DVBeuxp0ZvQLAul3/PThsC3YrnzA==",
"requires": {
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/context-base": "^0.12.0",
"semver": "^7.1.3"
},
"dependencies": {
"@opentelemetry/api": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.12.0.tgz",
"integrity": "sha512-Dn4vU5GlaBrIWzLpsM6xbJwKHdlpwBQ4Bd+cL9ofJP3hKT8jBXpBpribmyaqAzrajzzl2Yt8uTa9rFVLfjDAvw==",
"requires": {
"@opentelemetry/context-base": "^0.12.0"
}
},
"@opentelemetry/context-base": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.12.0.tgz",
"integrity": "sha512-UXwSsXo3F3yZ1dIBOG9ID8v2r9e+bqLWoizCtTb8rXtwF+N5TM7hzzvQz72o3nBU+zrI/D5e+OqAYK8ZgDd3DA=="
},
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
},
"@opentelemetry/resources": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-0.12.0.tgz",
"integrity": "sha512-8cYvIKB68cyupc7D6SWzkLtt13mbjgxMahL4JKCM6hWPyiGSJlPFEAey4XFXI5LLpPZRYTPHLVoLqI/xwCFZZA==",
"requires": {
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/core": "^0.12.0"
},
"dependencies": {
"@opentelemetry/api": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.12.0.tgz",
"integrity": "sha512-Dn4vU5GlaBrIWzLpsM6xbJwKHdlpwBQ4Bd+cL9ofJP3hKT8jBXpBpribmyaqAzrajzzl2Yt8uTa9rFVLfjDAvw==",
"requires": {
"@opentelemetry/context-base": "^0.12.0"
}
},
"@opentelemetry/context-base": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.12.0.tgz",
"integrity": "sha512-UXwSsXo3F3yZ1dIBOG9ID8v2r9e+bqLWoizCtTb8rXtwF+N5TM7hzzvQz72o3nBU+zrI/D5e+OqAYK8ZgDd3DA=="
}
}
},
"@opentelemetry/semantic-conventions": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-0.12.0.tgz",
"integrity": "sha512-BuCcDW0uLNYYTns0/LwXkJ8lp8aDm7kpS+WunEmPAPRSCe6ciOYRvzn5reqJfX93rf+6A3U2SgrBnCTH+0qoQQ=="
},
"@opentelemetry/tracing": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/tracing/-/tracing-0.12.0.tgz",
"integrity": "sha512-2TUGhTGkhgnxTciHCNAILPSeyXageJewRqfP9wOrx65sKd/jgvNYoY8nYf4EVWVMirDOxKDsmYgUkjdQrwb2dg==",
"requires": {
"@opentelemetry/api": "^0.12.0",
"@opentelemetry/context-base": "^0.12.0",
"@opentelemetry/core": "^0.12.0",
"@opentelemetry/resources": "^0.12.0",
"@opentelemetry/semantic-conventions": "^0.12.0"
},
"dependencies": {
"@opentelemetry/api": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.12.0.tgz",
"integrity": "sha512-Dn4vU5GlaBrIWzLpsM6xbJwKHdlpwBQ4Bd+cL9ofJP3hKT8jBXpBpribmyaqAzrajzzl2Yt8uTa9rFVLfjDAvw==",
"requires": {
"@opentelemetry/context-base": "^0.12.0"
}
},
"@opentelemetry/context-base": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.12.0.tgz",
"integrity": "sha512-UXwSsXo3F3yZ1dIBOG9ID8v2r9e+bqLWoizCtTb8rXtwF+N5TM7hzzvQz72o3nBU+zrI/D5e+OqAYK8ZgDd3DA=="
}
}
},
"@opentelemetry/types": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@opentelemetry/types/-/types-0.2.0.tgz",
......@@ -1697,6 +1915,14 @@
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz",
"integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ=="
},
"@types/duplexify": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/@types/duplexify/-/duplexify-3.6.0.tgz",
"integrity": "sha512-5zOA53RUlzN74bvrSGwjudssD9F3a797sDZQkiYpUOxW+WHaXTCPz4/d5Dgi6FKnOqZ2CpaTo0DhgIfsXAOE/A==",
"requires": {
"@types/node": "*"
}
},
"@types/express": {
"version": "4.17.2",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.2.tgz",
......@@ -4590,6 +4816,62 @@
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
"dev": true
},
"gtoken": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.2.1.tgz",
"integrity": "sha512-OY0BfPKe3QnMsY9MzTHTSKn+Vl2l1CcLe6BwDEQj00mbbkl5nyQ/7EUREstg4fQNZ8iYE7br4JJ7TdKeDOPWmw==",
"requires": {
"gaxios": "^4.0.0",
"google-p12-pem": "^3.0.3",
"jws": "^4.0.0"
},
"dependencies": {
"gaxios": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.2.0.tgz",
"integrity": "sha512-Ms7fNifGv0XVU+6eIyL9LB7RVESeML9+cMvkwGS70xyD6w2Z80wl6RiqiJ9k1KFlJCUTQqFFc8tXmPQfSKUe8g==",
"requires": {
"abort-controller": "^3.0.0",
"extend": "^3.0.2",
"https-proxy-agent": "^5.0.0",
"is-stream": "^2.0.0",
"node-fetch": "^2.3.0"
}
},
"google-p12-pem": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz",
"integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==",
"requires": {
"node-forge": "^0.10.0"
}
},
"is-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
},
"jwa": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
"integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
"requires": {
"buffer-equal-constant-time": "1.0.1",
"ecdsa-sig-formatter": "1.0.11",
"safe-buffer": "^5.0.1"
}
},
"jws": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
"requires": {
"jwa": "^2.0.0",
"safe-buffer": "^5.0.1"
}
}
}
},
"handlebars": {
"version": "4.7.3",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.3.tgz",
......@@ -5724,6 +6006,11 @@
"integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=",
"dev": true
},
"lodash.snakecase": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz",
"integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40="
},
"lodash.some": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
......@@ -7006,6 +7293,11 @@
"os-tmpdir": "^1.0.0"
}
},
"p-defer": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-3.0.0.tgz",
"integrity": "sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw=="
},
"p-finally": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
......
......@@ -30,14 +30,6 @@ export class AuthGroups {
return 'users.datalake.admins';
}
public static seistoreServicePrefix(): string {
return 'service.seistore.' + Config.SERVICE_ENV;
}
public static systemAdminGroupName(): string {
return this.seistoreServicePrefix() + '.admin';
}
public static async createGroup(
userToken: string, groupName: string, groupDescription: string, esd: string, appkey: string) {
await DESEntitlement.createGroup(userToken, groupName,
......@@ -62,9 +54,9 @@ export class AuthGroups {
for (const member of members) {
// DE allows to rm all so we may want to follow. For now exclude the requestor
if (member.email !== userEmail) {
await DESEntitlement.removeUserFromGroup(userToken, group, dataPartition, member.email,
appkey);
if (member.email !== userEmail && !member.email.startsWith('users.data.root')) {
await DESEntitlement.removeUserFromGroup(
userToken, group, dataPartition, member.email,appkey);
}
}
......
......@@ -130,6 +130,7 @@ export abstract class Config implements IConfig {
// DataGroups prefix
public static DATAGROUPS_PREFIX = 'data.sdms'
public static SERVICEGROUPS_PREFIX = 'service.seistore'
// Server SSL
public static SSL_ENABLED = false;
......
......@@ -41,7 +41,7 @@ export class AWSConfig extends Config {
// Logger
AWSConfig.LOGGER_LEVEL = process.env.LOGGER_LEVEL || 'info';
Config.initServiceConfiguration({
await Config.initServiceConfiguration({
SERVICE_ENV: process.env.SERVICE_ENV,
SERVICE_PORT: +process.env.PORT || 5000,
API_BASE_PATH: process.env.API_BASE_PATH,
......
......@@ -14,8 +14,8 @@
import { SubProjectModel } from '../../../services/subproject';
import { AbstractSeistore, SeistoreFactory } from '../../seistore';
import { Utils } from '../../../shared';
import { AbstractSeistore, SeistoreFactory } from '../../seistore';
@SeistoreFactory.register('aws')
export class AwsSeistore extends AbstractSeistore {
public checkExtraSubprojectCreateParams(requestBody: any, subproject: SubProjectModel) { return; }
......@@ -26,4 +26,8 @@ export class AwsSeistore extends AbstractSeistore {
const email = payload.username;
return internalSwapForSauth ? Utils.checkSauthV1EmailDomainName(email) : email;
}
public async notifySubprojectCreationStatus(subproject: SubProjectModel,
status: string): Promise<string> {
return 'Not Implemented';
}
}
......@@ -125,7 +125,7 @@ export class AWSStorage extends AbstractStorage {
Body: data
};
try {
this.s3.putObject(params).promise();
await this.s3.putObject(params).promise();
} catch (err) {
// tslint:disable-next-line:no-console
console.log(err.code + ': ' + err.message);
......@@ -140,7 +140,7 @@ export class AWSStorage extends AbstractStorage {
Key: folder + '/' + objectName
};
try {
this.s3.deleteObject(params).promise();
await this.s3.deleteObject(params).promise();
} catch (err) {
// tslint:disable-next-line:no-console
console.log(err.code + ': ' + err.message);
......
......@@ -30,4 +30,8 @@ export class AzureSeistore extends AbstractSeistore {
const email = payload.email === Config.IMP_SERVICE_ACCOUNT_SIGNER ? payload.obo : payload.email;
return internalSwapForSauth ? Utils.checkSauthV1EmailDomainName(email) : email;
}
public async notifySubprojectCreationStatus(
subproject: SubProjectModel, status: string): Promise<string> {
return 'Not Implemented';
}
}
......@@ -14,8 +14,8 @@
// limitations under the License.
// ============================================================================
import { Config, ConfigFactory } from '../../config';
import fs from 'fs';
import { Config, ConfigFactory } from '../../config';
@ConfigFactory.register('google')
export class ConfigGoogle extends Config {
......@@ -51,6 +51,9 @@ export class ConfigGoogle extends Config {
// max len for a group name in DE
public static DES_GROUP_CHAR_LIMIT = 128;
// pubsub topic
public static PUBSUBTOPIC: string;
public async init(): Promise<void> {
// load des target audiance for service to service communication
......@@ -70,6 +73,8 @@ export class ConfigGoogle extends Config {
ConfigGoogle.SERVICE_IDENTITY_PRIVATE_KEY_ID = data.private_key_id;
}
ConfigGoogle.PUBSUBTOPIC = process.env.PUBSUBTOPIC !== undefined ? process.env.PUBSUBTOPIC : 'subproject-operations';
await Config.initServiceConfiguration({
SERVICE_ENV: process.env.APP_ENVIRONMENT_IDENTIFIER,
SERVICE_PORT: +process.env.PORT || 5000,
......@@ -107,7 +112,7 @@ export class ConfigGoogle extends Config {
FEATURE_FLAG_LOGGING: process.env.FEATURE_FLAG_LOGGING !== undefined ?
process.env.FEATURE_FLAG_LOGGING !== 'false' : true,
FEATURE_FLAG_STACKDRIVER_EXPORTER: process.env.FEATURE_FLAG_STACKDRIVER_EXPORTER !== undefined ?
process.env.FEATURE_FLAG_STACKDRIVER_EXPORTER !== 'false' : true
process.env.FEATURE_FLAG_STACKDRIVER_EXPORTER !== 'false' : true,
});
}
......
......@@ -96,6 +96,7 @@ export class GCS extends AbstractStorage {
if (async) {
await this.getStorageclient().bucket(bucketName).deleteFiles({ prefix, force: true });
} else {
// tslint:disable-next-line: no-floating-promises
this.getStorageclient().bucket(bucketName).deleteFiles({ prefix, force: true });
}
}
......
......@@ -14,42 +14,53 @@
// limitations under the License.
// ============================================================================
import { PubSub } from '@google-cloud/pubsub';
import { SubProjectModel } from '../../../services/subproject';
import { Error, Params, Utils } from '../../../shared';
import { Config } from '../../config';
import { AbstractSeistore, SeistoreFactory } from '../../seistore';
import { ConfigGoogle } from './config';
// reference time zone and clss locations
const KSTORAGE_CLASS = ['MULTI_REGIONAL', 'REGIONAL', 'NEARLINE', 'COLDLINE'];
const KSTORAGE_LOCATION_MR = ['ASIA', 'EU', 'US'];
const KSTORAGE_LOCATION_RG = [
'NORTHAMERICA-NORTHEAST1',
'US-CENTRAL1',
'US-EAST1',
'US-EAST4',
'US-WEST1',
'US-WEST2',
'US-WEST3',
'US-WEST4',
'SOUTHAMERICA-EAST1',
'EUROPE-NORTH1',
'EUROPE-WEST1',
'EUROPE-WEST2',
'EUROPE-WEST3',
'EUROPE-WEST4',
'EUROPE-WEST6',
'ASIA-EAST1',
'ASIA-EAST2',
'ASIA-NORTHEAST1',
'ASIA-NORTHEAST2',
'ASIA-NORTHEAST3',
'ASIA-SOUTH1',
'ASIA-SOUTHEAST1',
'ASIA-SOUTHEAST2',
'AUSTRALIA-SOUTHEAST1'];
'NORTHAMERICA-NORTHEAST1',
'US-CENTRAL1',
'US-EAST1',
'US-EAST4',
'US-WEST1',
'US-WEST2',
'US-WEST3',
'US-WEST4',
'SOUTHAMERICA-EAST1',
'EUROPE-NORTH1',
'EUROPE-WEST1',
'EUROPE-WEST2',
'EUROPE-WEST3',
'EUROPE-WEST4',
'EUROPE-WEST6',
'ASIA-EAST1',
'ASIA-EAST2',
'ASIA-NORTHEAST1',
'ASIA-NORTHEAST2',
'ASIA-NORTHEAST3',
'ASIA-SOUTH1',
'ASIA-SOUTHEAST1',
'ASIA-SOUTHEAST2',
'AUSTRALIA-SOUTHEAST1'];
@SeistoreFactory.register('google')
export class GoogleSeistore extends AbstractSeistore {
private pubSubClient: PubSub;
constructor() {
super();
this.pubSubClient = new PubSub();