mirror of
https://gitlab.com/mobicoop/v3/service/auth.git
synced 2026-01-02 20:52:41 +00:00
start authorization module
This commit is contained in:
@@ -12,7 +12,7 @@ async function bootstrap() {
|
||||
package: 'authentication',
|
||||
protoPath: join(
|
||||
__dirname,
|
||||
'modules/auth/adapters/primaries/authentication.proto',
|
||||
'modules/authentication/adapters/primaries/authentication.proto',
|
||||
),
|
||||
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
|
||||
loader: { keepCase: true, enums: String },
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export class Authorization {
|
||||
uuid: string;
|
||||
action: string;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export class ValidateAuthorizationQuery {
|
||||
readonly uuid: string;
|
||||
readonly action: string;
|
||||
|
||||
constructor(uuid: string, action: string) {
|
||||
this.uuid = uuid;
|
||||
this.action = action;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user