-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
131 changed files
with
417 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...rc/infrastructure/config/client.config.ts → ...ccess-service/src/config/client.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ConfigModule } from '@diut/nest-core' | ||
import { ModuleMetadata } from '@nestjs/common' | ||
|
||
import { loadAppConfig } from './app.config' | ||
import { loadAuthConfig } from './auth.config' | ||
import { loadMinioConfig } from './minio.config' | ||
import { loadClientConfig } from './client.config' | ||
import { loadMongoConfig } from './mongo.config' | ||
import { loadLogConfig } from './log.config' | ||
|
||
export const configMetadata: ModuleMetadata = { | ||
imports: [ | ||
ConfigModule.forRoot({}), | ||
ConfigModule.forFeature(loadAppConfig), | ||
ConfigModule.forFeature(loadAuthConfig), | ||
ConfigModule.forFeature(loadClientConfig), | ||
ConfigModule.forFeature(loadLogConfig), | ||
ConfigModule.forFeature(loadMinioConfig), | ||
ConfigModule.forFeature(loadMongoConfig), | ||
], | ||
} |
1 change: 1 addition & 0 deletions
1
...src/infrastructure/config/mongo.config.ts → ...access-service/src/config/mongo.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export enum AuthSubject { | ||
BioProduct = 'bio-product', | ||
TestCategory = 'test-category', | ||
} |
32 changes: 0 additions & 32 deletions
32
apps/levansy-access-service/src/domain/entity/bio-product.ts
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
apps/levansy-access-service/src/domain/entity/bio-product/entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BaseEntity } from '../base-entity' | ||
|
||
export type BioProduct = BaseEntity & { | ||
index: number | ||
name: string | ||
} |
13 changes: 13 additions & 0 deletions
13
apps/levansy-access-service/src/domain/entity/bio-product/example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { EntityExample } from '../base-entity' | ||
import { BioProduct } from './entity' | ||
|
||
export const exampleBioProduct: EntityExample<BioProduct> = { | ||
index: { | ||
example: 1, | ||
description: 'index', | ||
}, | ||
name: { | ||
example: 'CHIV Advia centaur', | ||
description: 'name', | ||
}, | ||
} |
3 changes: 3 additions & 0 deletions
3
apps/levansy-access-service/src/domain/entity/bio-product/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './entity' | ||
export * from './example' | ||
export * from './permission' |
12 changes: 12 additions & 0 deletions
12
apps/levansy-access-service/src/domain/entity/bio-product/permission.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { AuthSubject } from '../auth-subject' | ||
import { EntityPermission } from '../permission' | ||
|
||
export enum BioProductActions { | ||
Manage = 'manage', | ||
Read = 'read', | ||
} | ||
|
||
export type BioProductPermissions = EntityPermission< | ||
AuthSubject.BioProduct, | ||
BioProductActions | ||
> |
26 changes: 0 additions & 26 deletions
26
apps/levansy-access-service/src/domain/entity/permission.ts
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
apps/levansy-access-service/src/domain/entity/permission/entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { MongoQuery } from '@casl/ability' | ||
|
||
import { BaseEntity } from '../base-entity' | ||
import { EntityPermission } from './mapping' | ||
|
||
export type Permission<TMapping extends EntityPermission = EntityPermission> = | ||
BaseEntity & { | ||
index: number | ||
name: string | ||
description: string | ||
rule: { | ||
subject: TMapping['subject'] | ||
action: TMapping['actions'][number] | ||
inverted?: boolean | ||
conditions?: MongoQuery<TMapping['subject']> | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
apps/levansy-access-service/src/domain/entity/permission/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './entity' | ||
export * from './mapping' |
9 changes: 9 additions & 0 deletions
9
apps/levansy-access-service/src/domain/entity/permission/mapping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { AuthSubject } from '../auth-subject' | ||
|
||
export type EntityPermission< | ||
TSubject extends AuthSubject = AuthSubject, | ||
TAction extends string = string, | ||
> = { | ||
subject: TSubject | ||
actions: TAction[] | ||
} |
4 changes: 2 additions & 2 deletions
4
...-access-service/src/domain/entity/role.ts → ...-service/src/domain/entity/role/entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './entity' |
7 changes: 7 additions & 0 deletions
7
apps/levansy-access-service/src/domain/entity/test-category/entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BaseEntity } from '../base-entity' | ||
|
||
export type TestCategory = BaseEntity & { | ||
index: number | ||
name: string | ||
reportIndex: number | ||
} |
9 changes: 2 additions & 7 deletions
9
...ervice/src/domain/entity/test-category.ts → ...rc/domain/entity/test-category/example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/levansy-access-service/src/domain/entity/test-category/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './entity' | ||
export * from './example' |
2 changes: 1 addition & 1 deletion
2
...-access-service/src/domain/entity/user.ts → ...-service/src/domain/entity/user/entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './entity' |
14 changes: 0 additions & 14 deletions
14
apps/levansy-access-service/src/domain/interface/auth/context.ts
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
apps/levansy-access-service/src/domain/interface/auth/index.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
apps/levansy-access-service/src/domain/interface/auth/payload.ts
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
apps/levansy-access-service/src/domain/interface/authorization/context.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ExecutionContext } from '@nestjs/common' | ||
|
||
import { User } from 'src/domain/entity' | ||
|
||
export const AuthorizationContextToken = Symbol('AuthorizationContext') | ||
|
||
export interface IAuthorizationContext { | ||
prepareData(context: ExecutionContext): Promise<void> | ||
getData(): ContextData | ||
} | ||
|
||
export type ContextData = { | ||
user: User | ||
} |
3 changes: 3 additions & 0 deletions
3
apps/levansy-access-service/src/domain/interface/authorization/exception.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { DomainException } from '../exception' | ||
|
||
export class AuthorizationException extends DomainException {} |
2 changes: 2 additions & 0 deletions
2
apps/levansy-access-service/src/domain/interface/authorization/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './context' | ||
export * from './exception' |
11 changes: 0 additions & 11 deletions
11
apps/levansy-access-service/src/domain/interface/config/app.config.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
apps/levansy-access-service/src/domain/interface/config/auth.config.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
apps/levansy-access-service/src/domain/interface/config/index.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
apps/levansy-access-service/src/domain/interface/config/minio.config.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export class DomainException extends Error {} |
3 changes: 0 additions & 3 deletions
3
apps/levansy-access-service/src/domain/interface/external/index.ts
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
apps/levansy-access-service/src/domain/interface/external/jwt-service.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './config' | ||
export * from './repository' | ||
export * from './external' | ||
export * from './auth' | ||
export * from './service' | ||
export * from './authorization' |
2 changes: 2 additions & 0 deletions
2
apps/levansy-access-service/src/domain/interface/service/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './puppeteer' | ||
export * from './storage' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.