Authentication middleware implementation on Gateway + Documentation implementation w/ auth

This commit is contained in:
rodrigo.zamboni
2022-01-27 18:18:31 -03:00
parent 332e0f0d80
commit a824a8768b
34 changed files with 4945 additions and 4060 deletions
+18 -3
View File
@@ -1,4 +1,4 @@
import { Module } from '@nestjs/common';
import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
import { InputGrpcClientModule } from './inputs/input-grpc-client.module';
import { UsersGrpcClientModule } from './users-grpc-client/users-grpc-client.module';
import { OutputsModule } from './outputs/outputs.module';
@@ -12,7 +12,13 @@ import { RestTransformationsModule } from './rest/rest-transformations/rest-tran
import { RestPipelinesModule } from './rest/rest-pipelines/rest-pipelines.module';
import { RestUserModule } from './rest/rest-user/rest-user.module';
import { RestFactoryModule } from './rest/rest-factory/rest-factory.module';
import { LoggerMiddleware } from './middlewares/authentication';
import { RestInputsController } from './rest/rest-inputs/rest-inputs.controller';
import { RestOutputsController } from './rest/rest-outputs/rest-outputs.controller';
import { RestTransformationsController } from './rest/rest-transformations/rest-transformations.controller';
import { RestPipelinesController } from './rest/rest-pipelines/rest-pipelines.controller';
import { RestEnrichmentsController } from './rest/rest-enrichments/rest-enrichments.controller';
import { RestFactoryController } from './rest/rest-factory/rest-factory.controller';
@Module({
imports: [
RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule,
@@ -25,4 +31,13 @@ import { RestFactoryModule } from './rest/rest-factory/rest-factory.module';
controllers: [],
providers: [],
})
export class AppModule {}
export class AppModule implements NestModule{
configure(consumer: MiddlewareConsumer) {
consumer
.apply(LoggerMiddleware)
.forRoutes(RestInputsController,RestOutputsController,RestTransformationsController,RestPipelinesController,RestEnrichmentsController,RestFactoryController)
}
}