-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clean the interfaces of the node js packages to be able to use i…
…njection dependences directly in the modules (#573) * fix: update mailer to use mailjet v6 * fix: update mailer to use mailjet v6 * feat: clean authentication modules * fix: update package lock * fix: resolve conversation and make the api start without settings env * chore(prerelease): prerelease next version 2.0.11-next.0 * fix: remove @tractr and replace it by @trxn * chore(prerelease): prerelease next version 2.0.11-next.1 * fix: add casl public permissions and MAILER_CLIENT token * chore(prerelease): prerelease next version 2.0.11-next.2 * fix: update MAILER_CLIENT providers * chore(prerelease): prerelease next version 2.0.11-next.3 * docs: add authentication documentation * chore(prerelease): prerelease next version 2.1.0-next.0 * chore(prerelease): prerelease next version 2.1.0-next.1
- Loading branch information
Showing
388 changed files
with
4,515 additions
and
3,382 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
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,4 @@ | ||
{ | ||
"name": "@trxn/traxion-api", | ||
"version": "2.0.13" | ||
"version": "2.1.0-next.1" | ||
} |
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,42 +1,20 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'; | ||
|
||
import { CaslModule } from './casl.module'; | ||
import { EncryptionModule } from './encryption.module'; | ||
import { ModelsModule } from './models.module'; | ||
import { UserModule } from './user.module'; | ||
|
||
import { getSelectPrismaUserQuery } from '@trxn/generated-casl'; | ||
import { USER_SERVICE } from '@trxn/generated-nestjs-models-common'; | ||
import { | ||
JwtGlobalAuthGuard, | ||
AuthenticationModule as TraxionAuthenticationModule, | ||
} from '@trxn/nestjs-authentication'; | ||
import { BcryptService } from '@trxn/nestjs-bcrypt'; | ||
import { CaslExceptionInterceptor, PoliciesGuard } from '@trxn/nestjs-casl'; | ||
import { AuthenticationModule as TraxionAuthenticationModule } from '@trxn/nestjs-authentication'; | ||
|
||
@Module({ | ||
imports: [ | ||
CaslModule, | ||
TraxionAuthenticationModule.registerAsync({ | ||
imports: [ModelsModule, EncryptionModule], | ||
useFactory: (userService, encryptionService) => ({ | ||
user: { | ||
customSelect: getSelectPrismaUserQuery(), | ||
}, | ||
jwtModuleOptions: { | ||
secret: 'secret', | ||
}, | ||
userService, | ||
encryptionService, | ||
}), | ||
inject: [USER_SERVICE, BcryptService], | ||
TraxionAuthenticationModule.register({ | ||
imports: [UserModule], | ||
customSelect: getSelectPrismaUserQuery(), | ||
jwtModuleOptions: { | ||
secret: 'secret', | ||
}, | ||
}), | ||
], | ||
providers: [ | ||
{ provide: APP_GUARD, useClass: JwtGlobalAuthGuard }, | ||
{ provide: APP_GUARD, useClass: PoliciesGuard }, | ||
{ provide: APP_INTERCEPTOR, useClass: CaslExceptionInterceptor }, | ||
], | ||
exports: [TraxionAuthenticationModule], | ||
}) | ||
export class AuthenticationModule {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,24 @@ import { Module } from '@nestjs/common'; | |
|
||
import { EncryptionModule } from './encryption.module'; | ||
import { MailerModule } from './mailer.module'; | ||
import { ModelsModule } from './models.module'; | ||
import { UserModule } from './user.module'; | ||
|
||
import { USER_SERVICE } from '@trxn/generated-nestjs-models-common'; | ||
import { BcryptService, EncryptionService } from '@trxn/nestjs-bcrypt'; | ||
import { ResetPasswordSendEmailService } from '@trxn/nestjs-mailer'; | ||
import { PasswordModule as TraxionPasswordModule } from '@trxn/nestjs-password'; | ||
import { BcryptService } from '@trxn/nestjs-bcrypt'; | ||
import { | ||
ENCRYPTION_SERVICE, | ||
PasswordModule as TraxionPasswordModule, | ||
} from '@trxn/nestjs-password'; | ||
import { ResetPasswordModule } from '@trxn/nestjs-reset-password'; | ||
|
||
@Module({ | ||
imports: [ | ||
TraxionPasswordModule.registerAsync({ | ||
imports: [ModelsModule, MailerModule, EncryptionModule], | ||
useFactory: ( | ||
userService, | ||
resetPasswordSendEmailService: ResetPasswordSendEmailService, | ||
encryptionService: EncryptionService, | ||
) => ({ | ||
resetPasswordSendEmail: { | ||
request: | ||
resetPasswordSendEmailService.sendRequestResetPasswordEmailFactory({ | ||
from: '[email protected]', | ||
}), | ||
updated: | ||
resetPasswordSendEmailService.sendUpdatedPasswordEmailFactory({ | ||
from: '[email protected]', | ||
}), | ||
}, | ||
userService, | ||
encryptionService, | ||
}), | ||
inject: [USER_SERVICE, ResetPasswordSendEmailService, BcryptService], | ||
TraxionPasswordModule.register({ | ||
imports: [UserModule, EncryptionModule], | ||
providers: [{ provide: ENCRYPTION_SERVICE, useExisting: BcryptService }], | ||
}), | ||
ResetPasswordModule.register({ | ||
imports: [UserModule, MailerModule], | ||
from: '[email protected]', | ||
}), | ||
], | ||
exports: [TraxionPasswordModule], | ||
|
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,15 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
import { ModelsModule } from './models.module'; | ||
|
||
import { UserModule as TraxionUserModule } from '@trxn/nestjs-user'; | ||
|
||
@Module({ | ||
imports: [ | ||
TraxionUserModule.register({ | ||
imports: [ModelsModule], | ||
}), | ||
], | ||
exports: [TraxionUserModule], | ||
}) | ||
export class UserModule {} |
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,9 @@ | ||
--- | ||
id: use-nestjs-user | ||
hide_title: true | ||
sidebar_label: The user module | ||
--- | ||
|
||
import SourceMarkdown from '../../../../../libs/nestjs/user/README.md'; | ||
|
||
<SourceMarkdown /> |
9 changes: 9 additions & 0 deletions
9
apps/docs/docs/how-to/authentication/1-use-nestjs-authentication copy.mdx
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 @@ | ||
--- | ||
id: use-nestjs-authentication | ||
hide_title: true | ||
sidebar_label: Authenticate your routes | ||
--- | ||
|
||
import SourceMarkdown from '../../../../../libs/nestjs/authentication/README.md'; | ||
|
||
<SourceMarkdown /> |
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 @@ | ||
--- | ||
id: use-nestjs-casl | ||
hide_title: true | ||
sidebar_label: Authorization | ||
--- | ||
|
||
import SourceMarkdown from '../../../../../libs/nestjs/casl/README.md'; | ||
|
||
<SourceMarkdown /> |
12 changes: 12 additions & 0 deletions
12
apps/docs/docs/how-to/authentication/3-use-nestjs-password copy.mdx
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 @@ | ||
--- | ||
id: use-nestjs-password | ||
hide_title: true | ||
sidebar_label: Play with the password | ||
--- | ||
|
||
import PasswordMarkdown from '../../../../../libs/nestjs/password/README.md'; | ||
import ResetPasswordMarkdown from '../../../../../libs/nestjs/reset-password/README.md'; | ||
|
||
<PasswordMarkdown /> | ||
|
||
<ResetPasswordMarkdown /> |
Oops, something went wrong.