Commit 6f42542a authored by Fabien Forestier's avatar Fabien Forestier
Browse files

Merge branch 'development' into 'master'

Version 3.2.3

See merge request refonte-data/legacy-auth-middleware!5
parents 521b9a5f 8a4e71b3
Pipeline #3139 passed with stage
in 12 seconds
......@@ -4,4 +4,6 @@ node_modules
!template.env
/dist
\ No newline at end of file
/dist
.vscode
\ No newline at end of file
{
"name": "legacy-auth-middleware",
"version": "3.2.1",
"version": "3.2.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -1484,14 +1484,6 @@
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
"integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw=="
},
"basic-auth": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
"integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
......@@ -1512,11 +1504,6 @@
"integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==",
"dev": true
},
"bintrees": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.1.tgz",
"integrity": "sha1-DmVcm5wkNeqraL9AJyJtK1WjRSQ="
},
"bitsyntax": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bitsyntax/-/bitsyntax-0.1.0.tgz",
......@@ -2641,15 +2628,6 @@
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==",
"dev": true
},
"cookies": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.3.tgz",
"integrity": "sha512-+gixgxYSgQLTaTIilDHAdlNPZDENDQernEMiIcZpYYP14zgHsCt4Ce1FEjFtcp6GefhozebB6orvhAAWx/IS0A==",
"requires": {
"depd": "~1.1.2",
"keygrip": "~1.0.3"
}
},
"copy-concurrently": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
......@@ -3055,14 +3033,15 @@
}
},
"dotenv": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.1.0.tgz",
"integrity": "sha512-/veDn2ztgRlB7gKmE3i9f6CmDIyXAy6d5nBq+whO9SLX+Zs1sXEgFLPi+aSuWqUuusMfbi84fT8j34fs1HaYUw=="
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz",
"integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w=="
},
"double-ended-queue": {
"version": "2.1.0-0",
"resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz",
"integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw="
"integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=",
"optional": true
},
"duplexer3": {
"version": "0.1.4",
......@@ -3996,7 +3975,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
......@@ -4017,12 +3997,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -4037,17 +4019,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -4164,7 +4149,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
......@@ -4176,6 +4162,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -4190,6 +4177,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -4197,12 +4185,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
......@@ -4221,6 +4211,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -4301,7 +4292,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
......@@ -4313,6 +4305,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -4398,7 +4391,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
......@@ -4434,6 +4428,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......@@ -4453,6 +4448,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
......@@ -4496,12 +4492,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
......@@ -6580,11 +6578,6 @@
"integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg==",
"optional": true
},
"keygrip": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.3.tgz",
"integrity": "sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g=="
},
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
......@@ -7400,11 +7393,6 @@
}
}
},
"natives": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz",
"integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA=="
},
"nats": {
"version": "1.2.10",
"resolved": "https://registry.npmjs.org/nats/-/nats-1.2.10.tgz",
......@@ -8182,14 +8170,6 @@
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
},
"prom-client": {
"version": "11.3.0",
"resolved": "https://registry.npmjs.org/prom-client/-/prom-client-11.3.0.tgz",
"integrity": "sha512-OqSf5WOvpGZXkfqPXUHNHpjrbEE/q8jxjktO0i7zg1cnULAtf0ET67/J5R4e4iA4MZx2260tzTzSFSWgMdTZmQ==",
"requires": {
"tdigest": "^0.1.1"
}
},
"promise-breaker": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/promise-breaker/-/promise-breaker-4.1.13.tgz",
......@@ -8809,6 +8789,7 @@
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz",
"integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==",
"optional": true,
"requires": {
"double-ended-queue": "^2.1.0-0",
"redis-commands": "^1.2.0",
......@@ -8818,7 +8799,8 @@
"redis-commands": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.4.0.tgz",
"integrity": "sha512-cu8EF+MtkwI4DLIT0x9P8qNTLFhQD4jLfxLR0cCNkeGzs87FN6879JOJwNQR/1zD7aSYNbU0hgsV9zGY71Itvw=="
"integrity": "sha512-cu8EF+MtkwI4DLIT0x9P8qNTLFhQD4jLfxLR0cCNkeGzs87FN6879JOJwNQR/1zD7aSYNbU0hgsV9zGY71Itvw==",
"optional": true
},
"redis-errors": {
"version": "1.2.0",
......@@ -8828,7 +8810,8 @@
"redis-parser": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz",
"integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs="
"integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=",
"optional": true
},
"reflect-metadata": {
"version": "0.1.12",
......@@ -10144,22 +10127,6 @@
"has-flag": "^3.0.0"
}
},
"swagger-stats": {
"version": "0.95.7",
"resolved": "https://registry.npmjs.org/swagger-stats/-/swagger-stats-0.95.7.tgz",
"integrity": "sha512-HGt3sZ8pcMEZCLpuAbISyuyiwYJMAjmNDI+8IPGnd+glrIeGdEEyqPBsxi0+2UT1SYjnrmjxtjPvBf/aHz51Og==",
"requires": {
"basic-auth": "^2.0.0",
"cookies": "^0.7.1",
"debug": "^3.1.0",
"moment": "^2.19.3",
"natives": "^1.1.6",
"path-to-regexp": "^2.1.0",
"prom-client": "^11.0.0",
"request": "^2.85.0",
"uuid": "^3.1.0"
}
},
"swagger-ui-dist": {
"version": "3.22.2",
"resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-3.22.2.tgz",
......@@ -10185,14 +10152,6 @@
"integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==",
"dev": true
},
"tdigest": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.1.tgz",
"integrity": "sha1-Ljyyw56kSeVdHmzZEReszKRYgCE=",
"requires": {
"bintrees": "1.0.1"
}
},
"term-size": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
......
{
"name": "legacy-auth-middleware",
"version": "3.2.2",
"version": "3.2.3",
"description": "",
"author": "",
"license": "MIT",
......@@ -28,7 +28,7 @@
"class-transformer": "^0.2.0",
"class-validator": "^0.9.1",
"cookie-parser": "^1.4.4",
"dotenv": "^6.1.0",
"dotenv": "^6.2.0",
"ioredis": "^4.10.0",
"jsonwebtoken": "^8.4.0",
"moment": "^2.24.0",
......@@ -39,7 +39,6 @@
"request-promise-native": "^1.0.5",
"rxjs": "^6.2.2",
"serve-favicon": "^2.5.0",
"swagger-stats": "^0.95.7",
"swagger-ui-express": "^4.0.2",
"typescript": "^3.0.1",
"uuid": "^3.3.2"
......@@ -78,4 +77,4 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
\ No newline at end of file
}
......@@ -2,12 +2,12 @@ import { Config } from './config';
import * as NodeRSA from 'node-rsa';
import { Redis } from '../helpers/redis.helper';
import { Logger, InternalServerErrorException } from '@nestjs/common';
import * as dotenv from 'dotenv';
export class ConfigService {
private _config = Config;
constructor() {
dotenv.config();
this._config.legacyAuthServiceUrl = process.env.LEGACY_AUTH_SERVICE_URL;
this._config.adminPassword = process.env.ADMIN_PASSWORD;
this._config.adminUsername = process.env.ADMIN_USERNAME;
......
......@@ -22,7 +22,6 @@ export class HealthCheckService implements TerminusOptionsFactory {
const healthEndpoint: TerminusEndpoint = {
url: '/health',
healthIndicators: [
async () => this._dnsHealthIndicator.pingCheck('LegacyAuthService', `${config.legacyAuthServiceUrl}/get_services`),
async () => this._dnsHealthIndicator.pingCheck('EmailService', `${config.serviceEmailUrl}/health`),
async () => this._redisHealthIndicator.checkRedisConnection(config.redis),
],
......
......@@ -3,14 +3,13 @@ import { AppModule } from './app.module';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import * as cookieParser from 'cookie-parser';
import * as swStats from 'swagger-stats';
import * as favicon from 'serve-favicon';
import * as path from 'path';
import { AppLogger } from './app-logger';
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: false,
logger: new AppLogger(),
});
app.enableCors({ credentials: true, origin: true });
......@@ -22,20 +21,15 @@ async function bootstrap() {
.setBasePath('')
.setTitle('Middleware Legacy Authentication')
.setDescription('This service acts as an interface between the new portail Data (or its services) and the legacy authentication service.')
.setVersion('0.1')
.setVersion(process.env.npm_package_version)
.build();
const document = SwaggerModule.createDocument(app, options);
// Enable stats middleware based on the generated swagger document
app.use(swStats.getMiddleware(document));
SwaggerModule.setup('api-doc', app, document);
app.useGlobalPipes(new ValidationPipe());
app.useLogger(app.get(AppLogger));
await app.listen(3000);
}
bootstrap();
Markdown is supported
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