start authorization module

This commit is contained in:
Gsk54 2023-01-16 17:04:43 +01:00
parent d5be05585d
commit c832d69c2e
6 changed files with 27 additions and 4 deletions

View File

@ -14,6 +14,7 @@ COPY --chown=node:node package*.json ./
# Install app dependencies using the `npm ci` command instead of `npm install` # Install app dependencies using the `npm ci` command instead of `npm install`
RUN npm ci RUN npm ci
RUN npx prisma generate
# Bundle app source # Bundle app source
COPY --chown=node:node . . COPY --chown=node:node . .

6
package-lock.json generated
View File

@ -1,13 +1,13 @@
{ {
"name": "auth", "name": "mobicoop-v3-auth",
"version": "0.0.1", "version": "0.0.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "auth", "name": "mobicoop-v3-auth",
"version": "0.0.1", "version": "0.0.1",
"license": "UNLICENSED", "license": "AGPL",
"dependencies": { "dependencies": {
"@automapper/classes": "^8.7.7", "@automapper/classes": "^8.7.7",
"@automapper/core": "^8.7.7", "@automapper/core": "^8.7.7",

View File

@ -12,7 +12,7 @@ async function bootstrap() {
package: 'authentication', package: 'authentication',
protoPath: join( protoPath: join(
__dirname, __dirname,
'modules/auth/adapters/primaries/authentication.proto', 'modules/authentication/adapters/primaries/authentication.proto',
), ),
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT, url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
loader: { keepCase: true, enums: String }, loader: { keepCase: true, enums: String },

View File

@ -0,0 +1,4 @@
export class Authorization {
uuid: string;
action: string;
}

View File

@ -0,0 +1,9 @@
import { QueryHandler } from '@nestjs/cqrs';
import { ValidateAuthorizationQuery } from '../../queries/validate-authorization.query';
@QueryHandler(ValidateAuthorizationQuery)
export class ValidateAuthenticationUseCase {
async execute(validate: ValidateAuthorizationQuery): Promise<boolean> {
return Promise.resolve(true);
}
}

View File

@ -0,0 +1,9 @@
export class ValidateAuthorizationQuery {
readonly uuid: string;
readonly action: string;
constructor(uuid: string, action: string) {
this.uuid = uuid;
this.action = action;
}
}