@os.io/nest-kit 0.0.1-alpha.0 → 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -30
- package/package.json +41 -5
- package/dist/auth/auth.constants.d.ts +0 -19
- package/dist/auth/auth.constants.d.ts.map +0 -1
- package/dist/auth/auth.constants.js +0 -19
- package/dist/auth/auth.constants.js.map +0 -1
- package/dist/auth/auth.guard.d.ts +0 -20
- package/dist/auth/auth.guard.d.ts.map +0 -1
- package/dist/auth/auth.guard.js +0 -84
- package/dist/auth/auth.guard.js.map +0 -1
- package/dist/auth/auth.module.d.ts +0 -26
- package/dist/auth/auth.module.d.ts.map +0 -1
- package/dist/auth/auth.module.js +0 -344
- package/dist/auth/auth.module.js.map +0 -1
- package/dist/auth/auth.options.d.ts +0 -179
- package/dist/auth/auth.options.d.ts.map +0 -1
- package/dist/auth/auth.options.js +0 -2
- package/dist/auth/auth.options.js.map +0 -1
- package/dist/auth/auth.service.d.ts +0 -57
- package/dist/auth/auth.service.d.ts.map +0 -1
- package/dist/auth/auth.service.js +0 -175
- package/dist/auth/auth.service.js.map +0 -1
- package/dist/auth/authorization/index.d.ts +0 -3
- package/dist/auth/authorization/index.d.ts.map +0 -1
- package/dist/auth/authorization/index.js +0 -3
- package/dist/auth/authorization/index.js.map +0 -1
- package/dist/auth/authorization/pbac/index.d.ts +0 -6
- package/dist/auth/authorization/pbac/index.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/index.js +0 -4
- package/dist/auth/authorization/pbac/index.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.decorator.d.ts +0 -18
- package/dist/auth/authorization/pbac/pbac.decorator.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.decorator.js +0 -14
- package/dist/auth/authorization/pbac/pbac.decorator.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.guard.d.ts +0 -19
- package/dist/auth/authorization/pbac/pbac.guard.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.guard.js +0 -60
- package/dist/auth/authorization/pbac/pbac.guard.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.service.d.ts +0 -44
- package/dist/auth/authorization/pbac/pbac.service.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.service.js +0 -146
- package/dist/auth/authorization/pbac/pbac.service.js.map +0 -1
- package/dist/auth/authorization/pbac/pbac.types.d.ts +0 -47
- package/dist/auth/authorization/pbac/pbac.types.d.ts.map +0 -1
- package/dist/auth/authorization/pbac/pbac.types.js +0 -2
- package/dist/auth/authorization/pbac/pbac.types.js.map +0 -1
- package/dist/auth/authorization/rbac/index.d.ts +0 -4
- package/dist/auth/authorization/rbac/index.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/index.js +0 -4
- package/dist/auth/authorization/rbac/index.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.decorator.d.ts +0 -18
- package/dist/auth/authorization/rbac/rbac.decorator.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.decorator.js +0 -25
- package/dist/auth/authorization/rbac/rbac.decorator.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.guard.d.ts +0 -19
- package/dist/auth/authorization/rbac/rbac.guard.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.guard.js +0 -50
- package/dist/auth/authorization/rbac/rbac.guard.js.map +0 -1
- package/dist/auth/authorization/rbac/rbac.service.d.ts +0 -43
- package/dist/auth/authorization/rbac/rbac.service.d.ts.map +0 -1
- package/dist/auth/authorization/rbac/rbac.service.js +0 -95
- package/dist/auth/authorization/rbac/rbac.service.js.map +0 -1
- package/dist/auth/decorators/current-user.decorator.d.ts +0 -17
- package/dist/auth/decorators/current-user.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/current-user.decorator.js +0 -23
- package/dist/auth/decorators/current-user.decorator.js.map +0 -1
- package/dist/auth/decorators/index.d.ts +0 -3
- package/dist/auth/decorators/index.d.ts.map +0 -1
- package/dist/auth/decorators/index.js +0 -3
- package/dist/auth/decorators/index.js.map +0 -1
- package/dist/auth/decorators/public.decorator.d.ts +0 -13
- package/dist/auth/decorators/public.decorator.d.ts.map +0 -1
- package/dist/auth/decorators/public.decorator.js +0 -15
- package/dist/auth/decorators/public.decorator.js.map +0 -1
- package/dist/auth/index.d.ts +0 -63
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -65
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/interfaces/auth-request.interface.d.ts +0 -18
- package/dist/auth/interfaces/auth-request.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-request.interface.js +0 -2
- package/dist/auth/interfaces/auth-request.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-result.interface.d.ts +0 -28
- package/dist/auth/interfaces/auth-result.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-result.interface.js +0 -2
- package/dist/auth/interfaces/auth-result.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-strategy.interface.d.ts +0 -37
- package/dist/auth/interfaces/auth-strategy.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-strategy.interface.js +0 -16
- package/dist/auth/interfaces/auth-strategy.interface.js.map +0 -1
- package/dist/auth/interfaces/auth-user.interface.d.ts +0 -25
- package/dist/auth/interfaces/auth-user.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/auth-user.interface.js +0 -2
- package/dist/auth/interfaces/auth-user.interface.js.map +0 -1
- package/dist/auth/interfaces/cache-service.interface.d.ts +0 -30
- package/dist/auth/interfaces/cache-service.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/cache-service.interface.js +0 -2
- package/dist/auth/interfaces/cache-service.interface.js.map +0 -1
- package/dist/auth/interfaces/index.d.ts +0 -8
- package/dist/auth/interfaces/index.d.ts.map +0 -1
- package/dist/auth/interfaces/index.js +0 -2
- package/dist/auth/interfaces/index.js.map +0 -1
- package/dist/auth/interfaces/user-service.interface.d.ts +0 -34
- package/dist/auth/interfaces/user-service.interface.d.ts.map +0 -1
- package/dist/auth/interfaces/user-service.interface.js +0 -2
- package/dist/auth/interfaces/user-service.interface.js.map +0 -1
- package/dist/auth/password/password.service.d.ts +0 -23
- package/dist/auth/password/password.service.d.ts.map +0 -1
- package/dist/auth/password/password.service.js +0 -52
- package/dist/auth/password/password.service.js.map +0 -1
- package/dist/auth/session/device-session.service.d.ts +0 -43
- package/dist/auth/session/device-session.service.d.ts.map +0 -1
- package/dist/auth/session/device-session.service.js +0 -72
- package/dist/auth/session/device-session.service.js.map +0 -1
- package/dist/auth/session/index.d.ts +0 -5
- package/dist/auth/session/index.d.ts.map +0 -1
- package/dist/auth/session/index.js +0 -4
- package/dist/auth/session/index.js.map +0 -1
- package/dist/auth/session/jwt.service.d.ts +0 -37
- package/dist/auth/session/jwt.service.d.ts.map +0 -1
- package/dist/auth/session/jwt.service.js +0 -119
- package/dist/auth/session/jwt.service.js.map +0 -1
- package/dist/auth/session/token-blacklist.service.d.ts +0 -37
- package/dist/auth/session/token-blacklist.service.d.ts.map +0 -1
- package/dist/auth/session/token-blacklist.service.js +0 -70
- package/dist/auth/session/token-blacklist.service.js.map +0 -1
- package/dist/auth/strategies/anonymous/anonymous.strategy.d.ts +0 -19
- package/dist/auth/strategies/anonymous/anonymous.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/anonymous/anonymous.strategy.js +0 -49
- package/dist/auth/strategies/anonymous/anonymous.strategy.js.map +0 -1
- package/dist/auth/strategies/base/base.strategy.d.ts +0 -11
- package/dist/auth/strategies/base/base.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/base/base.strategy.js +0 -6
- package/dist/auth/strategies/base/base.strategy.js.map +0 -1
- package/dist/auth/strategies/credentials/credentials.strategy.d.ts +0 -21
- package/dist/auth/strategies/credentials/credentials.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/credentials/credentials.strategy.js +0 -67
- package/dist/auth/strategies/credentials/credentials.strategy.js.map +0 -1
- package/dist/auth/strategies/index.d.ts +0 -12
- package/dist/auth/strategies/index.d.ts.map +0 -1
- package/dist/auth/strategies/index.js +0 -12
- package/dist/auth/strategies/index.js.map +0 -1
- package/dist/auth/strategies/magic-link/magic-link.strategy.d.ts +0 -31
- package/dist/auth/strategies/magic-link/magic-link.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/magic-link/magic-link.strategy.js +0 -88
- package/dist/auth/strategies/magic-link/magic-link.strategy.js.map +0 -1
- package/dist/auth/strategies/oauth/index.d.ts +0 -3
- package/dist/auth/strategies/oauth/index.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/index.js +0 -3
- package/dist/auth/strategies/oauth/index.js.map +0 -1
- package/dist/auth/strategies/oauth/oauth-provider-registry.d.ts +0 -13
- package/dist/auth/strategies/oauth/oauth-provider-registry.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/oauth-provider-registry.js +0 -20
- package/dist/auth/strategies/oauth/oauth-provider-registry.js.map +0 -1
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts +0 -23
- package/dist/auth/strategies/oauth/oauth.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/oauth/oauth.strategy.js +0 -79
- package/dist/auth/strategies/oauth/oauth.strategy.js.map +0 -1
- package/dist/auth/strategies/onetap/onetap.strategy.d.ts +0 -24
- package/dist/auth/strategies/onetap/onetap.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/onetap/onetap.strategy.js +0 -77
- package/dist/auth/strategies/onetap/onetap.strategy.js.map +0 -1
- package/dist/auth/strategies/otp/otp.strategy.d.ts +0 -31
- package/dist/auth/strategies/otp/otp.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/otp/otp.strategy.js +0 -93
- package/dist/auth/strategies/otp/otp.strategy.js.map +0 -1
- package/dist/auth/strategies/passkey/passkey.strategy.d.ts +0 -32
- package/dist/auth/strategies/passkey/passkey.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/passkey/passkey.strategy.js +0 -102
- package/dist/auth/strategies/passkey/passkey.strategy.js.map +0 -1
- package/dist/auth/strategies/sso/sso.strategy.d.ts +0 -25
- package/dist/auth/strategies/sso/sso.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/sso/sso.strategy.js +0 -80
- package/dist/auth/strategies/sso/sso.strategy.js.map +0 -1
- package/dist/auth/strategies/totp/totp.strategy.d.ts +0 -37
- package/dist/auth/strategies/totp/totp.strategy.d.ts.map +0 -1
- package/dist/auth/strategies/totp/totp.strategy.js +0 -109
- package/dist/auth/strategies/totp/totp.strategy.js.map +0 -1
- package/dist/auth/throttling/index.d.ts +0 -2
- package/dist/auth/throttling/index.d.ts.map +0 -1
- package/dist/auth/throttling/index.js +0 -2
- package/dist/auth/throttling/index.js.map +0 -1
- package/dist/auth/throttling/throttle.service.d.ts +0 -27
- package/dist/auth/throttling/throttle.service.d.ts.map +0 -1
- package/dist/auth/throttling/throttle.service.js +0 -63
- package/dist/auth/throttling/throttle.service.js.map +0 -1
- package/dist/bootstrap/cache/config.d.ts +0 -135
- package/dist/bootstrap/cache/config.d.ts.map +0 -1
- package/dist/bootstrap/cache/config.js +0 -189
- package/dist/bootstrap/cache/config.js.map +0 -1
- package/dist/bootstrap/cache/index.d.ts +0 -11
- package/dist/bootstrap/cache/index.d.ts.map +0 -1
- package/dist/bootstrap/cache/index.js +0 -11
- package/dist/bootstrap/cache/index.js.map +0 -1
- package/dist/bootstrap/index.d.ts +0 -21
- package/dist/bootstrap/index.d.ts.map +0 -1
- package/dist/bootstrap/index.js +0 -21
- package/dist/bootstrap/index.js.map +0 -1
- package/dist/bootstrap/scalar/api-docs.d.ts +0 -39
- package/dist/bootstrap/scalar/api-docs.d.ts.map +0 -1
- package/dist/bootstrap/scalar/api-docs.js +0 -41
- package/dist/bootstrap/scalar/api-docs.js.map +0 -1
- package/dist/bootstrap/scalar/index.d.ts +0 -39
- package/dist/bootstrap/scalar/index.d.ts.map +0 -1
- package/dist/bootstrap/scalar/index.js +0 -41
- package/dist/bootstrap/scalar/index.js.map +0 -1
- package/dist/bootstrap/swagger/api-docs.d.ts +0 -73
- package/dist/bootstrap/swagger/api-docs.d.ts.map +0 -1
- package/dist/bootstrap/swagger/api-docs.js +0 -87
- package/dist/bootstrap/swagger/api-docs.js.map +0 -1
- package/dist/bootstrap/swagger/index.d.ts +0 -37
- package/dist/bootstrap/swagger/index.d.ts.map +0 -1
- package/dist/bootstrap/swagger/index.js +0 -36
- package/dist/bootstrap/swagger/index.js.map +0 -1
- package/dist/bootstrap/typeorm/config/index.d.ts +0 -12
- package/dist/bootstrap/typeorm/config/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/config/index.js +0 -62
- package/dist/bootstrap/typeorm/config/index.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/controller.d.ts +0 -13
- package/dist/bootstrap/typeorm/crud/controller.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/controller.js +0 -72
- package/dist/bootstrap/typeorm/crud/controller.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/index.d.ts +0 -4
- package/dist/bootstrap/typeorm/crud/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/index.js +0 -3
- package/dist/bootstrap/typeorm/crud/index.js.map +0 -1
- package/dist/bootstrap/typeorm/crud/service.d.ts +0 -10
- package/dist/bootstrap/typeorm/crud/service.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/crud/service.js +0 -21
- package/dist/bootstrap/typeorm/crud/service.js.map +0 -1
- package/dist/bootstrap/typeorm/index.d.ts +0 -18
- package/dist/bootstrap/typeorm/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/index.js +0 -18
- package/dist/bootstrap/typeorm/index.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/factory.d.ts +0 -5
- package/dist/bootstrap/typeorm/uow/factory.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/factory.js +0 -27
- package/dist/bootstrap/typeorm/uow/factory.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/index.d.ts +0 -4
- package/dist/bootstrap/typeorm/uow/index.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/index.js +0 -4
- package/dist/bootstrap/typeorm/uow/index.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/transactional.decorator.d.ts +0 -62
- package/dist/bootstrap/typeorm/uow/transactional.decorator.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/transactional.decorator.js +0 -114
- package/dist/bootstrap/typeorm/uow/transactional.decorator.js.map +0 -1
- package/dist/bootstrap/typeorm/uow/unit-of-work.d.ts +0 -11
- package/dist/bootstrap/typeorm/uow/unit-of-work.d.ts.map +0 -1
- package/dist/bootstrap/typeorm/uow/unit-of-work.js +0 -23
- package/dist/bootstrap/typeorm/uow/unit-of-work.js.map +0 -1
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -11
- package/dist/core/index.js.map +0 -1
- package/dist/infra/audit-log/index.d.ts +0 -12
- package/dist/infra/audit-log/index.d.ts.map +0 -1
- package/dist/infra/audit-log/index.js +0 -13
- package/dist/infra/audit-log/index.js.map +0 -1
- package/dist/infra/index.d.ts +0 -20
- package/dist/infra/index.d.ts.map +0 -1
- package/dist/infra/index.js +0 -21
- package/dist/infra/index.js.map +0 -1
- package/dist/infra/logger/index.d.ts +0 -12
- package/dist/infra/logger/index.d.ts.map +0 -1
- package/dist/infra/logger/index.js +0 -13
- package/dist/infra/logger/index.js.map +0 -1
- package/dist/infra/metrics/index.d.ts +0 -18
- package/dist/infra/metrics/index.d.ts.map +0 -1
- package/dist/infra/metrics/index.js +0 -19
- package/dist/infra/metrics/index.js.map +0 -1
- package/dist/infra/notification/index.d.ts +0 -12
- package/dist/infra/notification/index.d.ts.map +0 -1
- package/dist/infra/notification/index.js +0 -13
- package/dist/infra/notification/index.js.map +0 -1
- package/dist/infra/storage/index.d.ts +0 -12
- package/dist/infra/storage/index.d.ts.map +0 -1
- package/dist/infra/storage/index.js +0 -13
- package/dist/infra/storage/index.js.map +0 -1
- package/dist/infra/stripe/index.d.ts +0 -12
- package/dist/infra/stripe/index.d.ts.map +0 -1
- package/dist/infra/stripe/index.js +0 -13
- package/dist/infra/stripe/index.js.map +0 -1
- package/dist/saas/index.d.ts +0 -18
- package/dist/saas/index.d.ts.map +0 -1
- package/dist/saas/index.js +0 -19
- package/dist/saas/index.js.map +0 -1
package/dist/auth/auth.module.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var AuthModule_1;
|
|
8
|
-
import { Module, Logger } from '@nestjs/common';
|
|
9
|
-
import { AUTH_MODULE_OPTIONS, AUTH_STRATEGIES, CACHE_SERVICE, USER_SERVICE, } from './auth.constants';
|
|
10
|
-
import { AuthService } from './auth.service';
|
|
11
|
-
import { AuthGuard } from './auth.guard';
|
|
12
|
-
import { PasswordService } from './password/password.service';
|
|
13
|
-
import { JwtService } from './session/jwt.service';
|
|
14
|
-
import { TokenBlacklistService } from './session/token-blacklist.service';
|
|
15
|
-
import { DeviceSessionService } from './session/device-session.service';
|
|
16
|
-
import { ThrottleService } from './throttling/throttle.service';
|
|
17
|
-
import { CredentialsStrategy } from './strategies/credentials/credentials.strategy';
|
|
18
|
-
import { OAuthStrategy, OAuthProviderRegistry } from './strategies/oauth/index';
|
|
19
|
-
import { TotpStrategy } from './strategies/totp/totp.strategy';
|
|
20
|
-
import { AnonymousStrategy } from './strategies/anonymous/anonymous.strategy';
|
|
21
|
-
import { MagicLinkStrategy } from './strategies/magic-link/magic-link.strategy';
|
|
22
|
-
import { OtpStrategy } from './strategies/otp/otp.strategy';
|
|
23
|
-
import { PasskeyStrategy } from './strategies/passkey/passkey.strategy';
|
|
24
|
-
import { OneTapStrategy } from './strategies/onetap/onetap.strategy';
|
|
25
|
-
import { SsoStrategy } from './strategies/sso/sso.strategy';
|
|
26
|
-
import { RbacService, RbacGuard } from './authorization/rbac';
|
|
27
|
-
import { PbacService, PbacGuard } from './authorization/pbac';
|
|
28
|
-
const logger = new Logger('AuthModule');
|
|
29
|
-
let AuthModule = AuthModule_1 = class AuthModule {
|
|
30
|
-
/**
|
|
31
|
-
* Configure the auth module synchronously.
|
|
32
|
-
*/
|
|
33
|
-
static forRoot(options, extraProviders = []) {
|
|
34
|
-
return AuthModule_1.buildModule(options, extraProviders);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Configure the auth module asynchronously.
|
|
38
|
-
*/
|
|
39
|
-
static forRootAsync(options) {
|
|
40
|
-
const asyncProviders = AuthModule_1.createAsyncProviders(options);
|
|
41
|
-
const strategyProviders = AuthModule_1.createStrategyProviders(true);
|
|
42
|
-
const coreProviders = AuthModule_1.createCoreProviders();
|
|
43
|
-
const authzProviders = AuthModule_1.createAuthzProviders();
|
|
44
|
-
const enabledStrategiesProvider = AuthModule_1.createEnabledStrategiesProvider();
|
|
45
|
-
return {
|
|
46
|
-
module: AuthModule_1,
|
|
47
|
-
global: options.global ?? true,
|
|
48
|
-
imports: options.imports ?? [],
|
|
49
|
-
providers: [
|
|
50
|
-
...asyncProviders,
|
|
51
|
-
...strategyProviders,
|
|
52
|
-
...coreProviders,
|
|
53
|
-
...authzProviders,
|
|
54
|
-
enabledStrategiesProvider,
|
|
55
|
-
...(options.extraProviders ?? []),
|
|
56
|
-
],
|
|
57
|
-
exports: AuthModule_1.getExports(),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
static buildModule(options, extraProviders) {
|
|
61
|
-
const providers = [
|
|
62
|
-
{ provide: AUTH_MODULE_OPTIONS, useValue: options },
|
|
63
|
-
...AuthModule_1.createStrategyProviders(false),
|
|
64
|
-
...AuthModule_1.createCoreProviders(),
|
|
65
|
-
...AuthModule_1.createAuthzProviders(),
|
|
66
|
-
AuthModule_1.createEnabledStrategiesProvider(),
|
|
67
|
-
...extraProviders,
|
|
68
|
-
];
|
|
69
|
-
if (!options.cacheServiceToken) {
|
|
70
|
-
logger.warn('You must register a provider under the "CACHE_SERVICE" injection token. ' +
|
|
71
|
-
'See AuthModuleOptions.cacheServiceToken.');
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
module: AuthModule_1,
|
|
75
|
-
global: options.global ?? true,
|
|
76
|
-
providers,
|
|
77
|
-
exports: AuthModule_1.getExports(),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
static createAsyncProviders(options) {
|
|
81
|
-
return [
|
|
82
|
-
{
|
|
83
|
-
provide: AUTH_MODULE_OPTIONS,
|
|
84
|
-
useFactory: options.useFactory,
|
|
85
|
-
inject: options.inject ?? [],
|
|
86
|
-
},
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Conditionally register strategy classes based on config.
|
|
91
|
-
* Only enabled strategies are registered as providers.
|
|
92
|
-
*/
|
|
93
|
-
static createStrategyProviders(async) {
|
|
94
|
-
const providers = [];
|
|
95
|
-
// Credentials — enabled by default (unless explicitly false)
|
|
96
|
-
providers.push({
|
|
97
|
-
provide: CredentialsStrategy,
|
|
98
|
-
useFactory: (...args) => {
|
|
99
|
-
const options = args[0];
|
|
100
|
-
if (options.credentials === false) {
|
|
101
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('credentials'));
|
|
102
|
-
}
|
|
103
|
-
return new CredentialsStrategy(args[1], args[2], args[3]);
|
|
104
|
-
},
|
|
105
|
-
inject: async
|
|
106
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, PasswordService, JwtService]
|
|
107
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, PasswordService, JwtService],
|
|
108
|
-
});
|
|
109
|
-
// OAuth — enabled when config provided
|
|
110
|
-
providers.push({
|
|
111
|
-
provide: OAuthStrategy,
|
|
112
|
-
useFactory: (...args) => {
|
|
113
|
-
const options = args[0];
|
|
114
|
-
if (!options.oauth) {
|
|
115
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('oauth'));
|
|
116
|
-
}
|
|
117
|
-
const registry = new OAuthProviderRegistry();
|
|
118
|
-
const oauthOpts = options.oauth;
|
|
119
|
-
for (const [provider, cfg] of Object.entries(oauthOpts)) {
|
|
120
|
-
if (typeof cfg === 'object' && cfg !== null) {
|
|
121
|
-
registry.register(provider, cfg);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return new OAuthStrategy(args[1], args[2], registry);
|
|
125
|
-
},
|
|
126
|
-
inject: async
|
|
127
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService]
|
|
128
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService],
|
|
129
|
-
});
|
|
130
|
-
// TOTP — enabled when config provided
|
|
131
|
-
providers.push({
|
|
132
|
-
provide: TotpStrategy,
|
|
133
|
-
useFactory: (...args) => {
|
|
134
|
-
const options = args[0];
|
|
135
|
-
if (!options.totp) {
|
|
136
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('totp'));
|
|
137
|
-
}
|
|
138
|
-
return new TotpStrategy(args[1], args[2]);
|
|
139
|
-
},
|
|
140
|
-
inject: async
|
|
141
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService]
|
|
142
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService],
|
|
143
|
-
});
|
|
144
|
-
// Anonymous — enabled when config provided
|
|
145
|
-
providers.push({
|
|
146
|
-
provide: AnonymousStrategy,
|
|
147
|
-
useFactory: (...args) => {
|
|
148
|
-
const options = args[0];
|
|
149
|
-
if (!options.anonymous) {
|
|
150
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('anonymous'));
|
|
151
|
-
}
|
|
152
|
-
return new AnonymousStrategy(args[1]);
|
|
153
|
-
},
|
|
154
|
-
inject: async
|
|
155
|
-
? [AUTH_MODULE_OPTIONS, JwtService]
|
|
156
|
-
: [AUTH_MODULE_OPTIONS, JwtService],
|
|
157
|
-
});
|
|
158
|
-
// Magic Link — enabled when config provided
|
|
159
|
-
providers.push({
|
|
160
|
-
provide: MagicLinkStrategy,
|
|
161
|
-
useFactory: (...args) => {
|
|
162
|
-
const options = args[0];
|
|
163
|
-
if (!options.magicLink) {
|
|
164
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('magic-link'));
|
|
165
|
-
}
|
|
166
|
-
return new MagicLinkStrategy(args[1], args[2], args[3]);
|
|
167
|
-
},
|
|
168
|
-
inject: async
|
|
169
|
-
? [AUTH_MODULE_OPTIONS, CACHE_SERVICE, USER_SERVICE, JwtService]
|
|
170
|
-
: [AUTH_MODULE_OPTIONS, CACHE_SERVICE, USER_SERVICE, JwtService],
|
|
171
|
-
});
|
|
172
|
-
// OTP — enabled when config provided
|
|
173
|
-
providers.push({
|
|
174
|
-
provide: OtpStrategy,
|
|
175
|
-
useFactory: (...args) => {
|
|
176
|
-
const options = args[0];
|
|
177
|
-
if (!options.otp) {
|
|
178
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('otp'));
|
|
179
|
-
}
|
|
180
|
-
return new OtpStrategy(args[1], args[2], args[3]);
|
|
181
|
-
},
|
|
182
|
-
inject: async
|
|
183
|
-
? [AUTH_MODULE_OPTIONS, CACHE_SERVICE, USER_SERVICE, JwtService]
|
|
184
|
-
: [AUTH_MODULE_OPTIONS, CACHE_SERVICE, USER_SERVICE, JwtService],
|
|
185
|
-
});
|
|
186
|
-
// Passkey — enabled when config provided
|
|
187
|
-
providers.push({
|
|
188
|
-
provide: PasskeyStrategy,
|
|
189
|
-
useFactory: (...args) => {
|
|
190
|
-
const options = args[0];
|
|
191
|
-
if (!options.passkey) {
|
|
192
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('passkey'));
|
|
193
|
-
}
|
|
194
|
-
return new PasskeyStrategy(args[1], args[2]);
|
|
195
|
-
},
|
|
196
|
-
inject: async
|
|
197
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService]
|
|
198
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService],
|
|
199
|
-
});
|
|
200
|
-
// OneTap — enabled when config provided
|
|
201
|
-
providers.push({
|
|
202
|
-
provide: OneTapStrategy,
|
|
203
|
-
useFactory: (...args) => {
|
|
204
|
-
const options = args[0];
|
|
205
|
-
if (!options.onetap) {
|
|
206
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('onetap'));
|
|
207
|
-
}
|
|
208
|
-
return new OneTapStrategy(args[1], args[2]);
|
|
209
|
-
},
|
|
210
|
-
inject: async
|
|
211
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService]
|
|
212
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService],
|
|
213
|
-
});
|
|
214
|
-
// SSO — enabled when config provided
|
|
215
|
-
providers.push({
|
|
216
|
-
provide: SsoStrategy,
|
|
217
|
-
useFactory: (...args) => {
|
|
218
|
-
const options = args[0];
|
|
219
|
-
if (!options.sso) {
|
|
220
|
-
return AuthModule_1.createDisabledStrategy(AuthModule_1.nameFor('sso'));
|
|
221
|
-
}
|
|
222
|
-
return new SsoStrategy(args[1], args[2]);
|
|
223
|
-
},
|
|
224
|
-
inject: async
|
|
225
|
-
? [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService]
|
|
226
|
-
: [AUTH_MODULE_OPTIONS, USER_SERVICE, JwtService],
|
|
227
|
-
});
|
|
228
|
-
return providers;
|
|
229
|
-
}
|
|
230
|
-
static createCoreProviders() {
|
|
231
|
-
return [
|
|
232
|
-
AuthService,
|
|
233
|
-
AuthGuard,
|
|
234
|
-
PasswordService,
|
|
235
|
-
JwtService,
|
|
236
|
-
TokenBlacklistService,
|
|
237
|
-
DeviceSessionService,
|
|
238
|
-
ThrottleService,
|
|
239
|
-
];
|
|
240
|
-
}
|
|
241
|
-
static createAuthzProviders() {
|
|
242
|
-
return [
|
|
243
|
-
RbacGuard,
|
|
244
|
-
{
|
|
245
|
-
provide: RbacService,
|
|
246
|
-
useFactory: (cache) => {
|
|
247
|
-
return new RbacService(cache);
|
|
248
|
-
},
|
|
249
|
-
inject: [CACHE_SERVICE],
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
provide: PbacGuard,
|
|
253
|
-
useFactory: (reflector, pbacService) => {
|
|
254
|
-
return new PbacGuard(reflector, pbacService);
|
|
255
|
-
},
|
|
256
|
-
inject: ['Reflector', PbacService],
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
provide: PbacService,
|
|
260
|
-
useFactory: (cache) => {
|
|
261
|
-
return new PbacService(cache);
|
|
262
|
-
},
|
|
263
|
-
inject: [CACHE_SERVICE],
|
|
264
|
-
},
|
|
265
|
-
];
|
|
266
|
-
}
|
|
267
|
-
static createEnabledStrategiesProvider() {
|
|
268
|
-
return {
|
|
269
|
-
provide: AUTH_STRATEGIES,
|
|
270
|
-
useFactory: (credentials, oauth, totp, anonymous, magicLink, otp, passkey, onetap, sso) => {
|
|
271
|
-
const all = [
|
|
272
|
-
credentials,
|
|
273
|
-
oauth,
|
|
274
|
-
totp,
|
|
275
|
-
anonymous,
|
|
276
|
-
magicLink,
|
|
277
|
-
otp,
|
|
278
|
-
passkey,
|
|
279
|
-
onetap,
|
|
280
|
-
sso,
|
|
281
|
-
];
|
|
282
|
-
return all.filter((s) => !s._disabled);
|
|
283
|
-
},
|
|
284
|
-
inject: [
|
|
285
|
-
CredentialsStrategy,
|
|
286
|
-
OAuthStrategy,
|
|
287
|
-
TotpStrategy,
|
|
288
|
-
AnonymousStrategy,
|
|
289
|
-
MagicLinkStrategy,
|
|
290
|
-
OtpStrategy,
|
|
291
|
-
PasskeyStrategy,
|
|
292
|
-
OneTapStrategy,
|
|
293
|
-
SsoStrategy,
|
|
294
|
-
],
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
static getExports() {
|
|
298
|
-
return [
|
|
299
|
-
AuthService,
|
|
300
|
-
AuthGuard,
|
|
301
|
-
RbacService,
|
|
302
|
-
RbacGuard,
|
|
303
|
-
PbacService,
|
|
304
|
-
PbacGuard,
|
|
305
|
-
PasswordService,
|
|
306
|
-
JwtService,
|
|
307
|
-
TokenBlacklistService,
|
|
308
|
-
DeviceSessionService,
|
|
309
|
-
ThrottleService,
|
|
310
|
-
CredentialsStrategy,
|
|
311
|
-
OAuthStrategy,
|
|
312
|
-
OAuthProviderRegistry,
|
|
313
|
-
TotpStrategy,
|
|
314
|
-
AnonymousStrategy,
|
|
315
|
-
MagicLinkStrategy,
|
|
316
|
-
OtpStrategy,
|
|
317
|
-
PasskeyStrategy,
|
|
318
|
-
OneTapStrategy,
|
|
319
|
-
SsoStrategy,
|
|
320
|
-
];
|
|
321
|
-
}
|
|
322
|
-
static createDisabledStrategy(name) {
|
|
323
|
-
const s = new DisabledStrategy();
|
|
324
|
-
s._name = name;
|
|
325
|
-
return s;
|
|
326
|
-
}
|
|
327
|
-
static nameFor(method) {
|
|
328
|
-
return method;
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
AuthModule = AuthModule_1 = __decorate([
|
|
332
|
-
Module({})
|
|
333
|
-
], AuthModule);
|
|
334
|
-
export { AuthModule };
|
|
335
|
-
class DisabledStrategy {
|
|
336
|
-
_disabled = true;
|
|
337
|
-
_name = 'disabled';
|
|
338
|
-
type = '';
|
|
339
|
-
name = 'disabled';
|
|
340
|
-
authenticate() {
|
|
341
|
-
throw new Error(`Strategy "${this._name}" is not enabled`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
//# sourceMappingURL=auth.module.js.map
|
|
@@ -1 +0,0 @@
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F,CAAA;AA/VY,UAAU;IADtB,MAAM,CAAC,EAAE,CAAC;GACE,UAAU,CA+VtB;;AAED,MAAM,gBAAgB;IACpB,SAAS,GAAG,IAAI,CAAC;IACjB,KAAK,GAAG,UAAU,CAAC;IACnB,IAAI,GAAG,EAAW,CAAC;IACnB,IAAI,GAAG,UAAU,CAAC;IAElB,YAAY;QACV,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,kBAAkB,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import type { Provider, DynamicModule, Type } from '@nestjs/common';
|
|
2
|
-
import type { AuthMethod } from './interfaces';
|
|
3
|
-
export interface CredentialsOptions {
|
|
4
|
-
/** Enable email login (default true) */
|
|
5
|
-
email?: boolean;
|
|
6
|
-
/** Enable username login (default false) */
|
|
7
|
-
username?: boolean;
|
|
8
|
-
/** Require email verification before login (default false) */
|
|
9
|
-
requireEmailVerification?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface OAuthProviderConfig {
|
|
12
|
-
clientId: string;
|
|
13
|
-
clientSecret: string;
|
|
14
|
-
callbackUrl: string;
|
|
15
|
-
scopes?: string[];
|
|
16
|
-
additionalParams?: Record<string, string>;
|
|
17
|
-
}
|
|
18
|
-
export interface OAuthOptions {
|
|
19
|
-
google?: OAuthProviderConfig;
|
|
20
|
-
github?: OAuthProviderConfig;
|
|
21
|
-
facebook?: OAuthProviderConfig;
|
|
22
|
-
apple?: OAuthProviderConfig;
|
|
23
|
-
microsoft?: OAuthProviderConfig;
|
|
24
|
-
discord?: OAuthProviderConfig;
|
|
25
|
-
custom?: Record<string, OAuthProviderConfig>;
|
|
26
|
-
}
|
|
27
|
-
export interface TOTPOptions {
|
|
28
|
-
/** Issuer name shown in authenticator apps (default "NestKit") */
|
|
29
|
-
issuer?: string;
|
|
30
|
-
/** Number of backup codes to generate (default 8) */
|
|
31
|
-
backupCodeCount?: number;
|
|
32
|
-
/** Algorithm: 'sha1' | 'sha256' | 'sha512' (default 'sha1') */
|
|
33
|
-
algorithm?: 'sha1' | 'sha256' | 'sha512';
|
|
34
|
-
/** Number of digits (default 6) */
|
|
35
|
-
digits?: number;
|
|
36
|
-
/** TOTP step window (seconds, default 30) */
|
|
37
|
-
period?: number;
|
|
38
|
-
}
|
|
39
|
-
export interface AnonymousOptions {
|
|
40
|
-
/** Prefix for anonymous user IDs (default "anon_") */
|
|
41
|
-
idPrefix?: string;
|
|
42
|
-
/** Whether anonymous sessions can be persisted (default true) */
|
|
43
|
-
allowConversion?: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface MagicLinkOptions {
|
|
46
|
-
/** Token expiry in seconds (default 900 / 15 min) */
|
|
47
|
-
tokenExpiresIn?: number;
|
|
48
|
-
/** Token length in bytes (default 32) */
|
|
49
|
-
tokenBytes?: number;
|
|
50
|
-
}
|
|
51
|
-
export interface OTPOptions {
|
|
52
|
-
/** OTP code length (default 6) */
|
|
53
|
-
digits?: number;
|
|
54
|
-
/** OTP expiry in seconds (default 300 / 5 min) */
|
|
55
|
-
expiresIn?: number;
|
|
56
|
-
/** Max allowed attempts before code is invalidated (default 3) */
|
|
57
|
-
maxAttempts?: number;
|
|
58
|
-
}
|
|
59
|
-
export interface PasskeyOptions {
|
|
60
|
-
/** Relying Party name (default "NestKit") */
|
|
61
|
-
rpName?: string;
|
|
62
|
-
/** Relying Party ID (default request hostname) */
|
|
63
|
-
rpId?: string;
|
|
64
|
-
/** Origin URL(s) allowed (default [request origin]) */
|
|
65
|
-
origins?: string[];
|
|
66
|
-
/** Timeout for WebAuthn ceremonies (ms, default 60000) */
|
|
67
|
-
timeout?: number;
|
|
68
|
-
}
|
|
69
|
-
export interface OneTapOptions {
|
|
70
|
-
google?: {
|
|
71
|
-
clientId: string;
|
|
72
|
-
};
|
|
73
|
-
apple?: {
|
|
74
|
-
clientId: string;
|
|
75
|
-
keyId: string;
|
|
76
|
-
teamId: string;
|
|
77
|
-
privateKey: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export interface SSOOptions {
|
|
81
|
-
/** SAML providers */
|
|
82
|
-
saml?: Record<string, SamlProviderConfig>;
|
|
83
|
-
/** OIDC providers */
|
|
84
|
-
oidc?: Record<string, OidcProviderConfig>;
|
|
85
|
-
}
|
|
86
|
-
export interface SamlProviderConfig {
|
|
87
|
-
entryPoint: string;
|
|
88
|
-
issuer: string;
|
|
89
|
-
cert?: string;
|
|
90
|
-
privateKey?: string;
|
|
91
|
-
callbackUrl: string;
|
|
92
|
-
}
|
|
93
|
-
export interface OidcProviderConfig {
|
|
94
|
-
issuerUrl: string;
|
|
95
|
-
clientId: string;
|
|
96
|
-
clientSecret: string;
|
|
97
|
-
callbackUrl: string;
|
|
98
|
-
scopes?: string[];
|
|
99
|
-
}
|
|
100
|
-
export interface RBACOptions {
|
|
101
|
-
/** Key in JWT payload that holds roles (default "roles") */
|
|
102
|
-
rolesClaim?: string;
|
|
103
|
-
/** Whether to require at least one role on protected routes (default true) */
|
|
104
|
-
requireRole?: boolean;
|
|
105
|
-
}
|
|
106
|
-
export interface PBACOptions {
|
|
107
|
-
/** Policy evaluation mode (default "deny-unless-permit") */
|
|
108
|
-
defaultEffect?: 'deny-unless-permit' | 'permit-unless-deny';
|
|
109
|
-
}
|
|
110
|
-
export interface SessionOptions {
|
|
111
|
-
/** Access token TTL (default "15m") */
|
|
112
|
-
accessTokenExpiresIn?: string;
|
|
113
|
-
/** Refresh token TTL (default "7d") */
|
|
114
|
-
refreshTokenExpiresIn?: string;
|
|
115
|
-
/** JWT signing algorithm (default "HS256") */
|
|
116
|
-
algorithm?: 'HS256' | 'RS256' | 'ES256';
|
|
117
|
-
/** Custom issuer claim */
|
|
118
|
-
issuer?: string;
|
|
119
|
-
/** Custom audience claim */
|
|
120
|
-
audience?: string;
|
|
121
|
-
/** Blacklist TTL (seconds, default = refresh token TTL) */
|
|
122
|
-
blacklistTtl?: number;
|
|
123
|
-
/** Enable refresh token rotation (default true) */
|
|
124
|
-
rotation?: boolean;
|
|
125
|
-
/** Enable multi-device tracking (default false) */
|
|
126
|
-
multiDevice?: boolean;
|
|
127
|
-
}
|
|
128
|
-
export interface ThrottleOptions {
|
|
129
|
-
/** Max login attempts per window (default 5) */
|
|
130
|
-
maxAttempts?: number;
|
|
131
|
-
/** Window duration in seconds (default 900 / 15 min) */
|
|
132
|
-
windowSeconds?: number;
|
|
133
|
-
}
|
|
134
|
-
export interface AuthModuleOptions {
|
|
135
|
-
/** JWT secret (required for HS256, ignored for RS256/ES256) */
|
|
136
|
-
jwtSecret?: string;
|
|
137
|
-
/** Private key PEM (required for RS256/ES256) */
|
|
138
|
-
jwtPrivateKey?: string;
|
|
139
|
-
/** Public key PEM (required for RS256/ES256) */
|
|
140
|
-
jwtPublicKey?: string;
|
|
141
|
-
/** Bcrypt cost rounds (default 12) */
|
|
142
|
-
passwordRounds?: number;
|
|
143
|
-
/** Injection token for your cache-service provider (default 'CACHE_SERVICE') */
|
|
144
|
-
cacheServiceToken?: string;
|
|
145
|
-
/**
|
|
146
|
-
* Injection token for your user-service provider (default 'USER_SERVICE').
|
|
147
|
-
* The token must resolve to an object implementing IUserService.
|
|
148
|
-
*/
|
|
149
|
-
userServiceToken?: string;
|
|
150
|
-
/** Additional NestJS providers to register (e.g. your own services) */
|
|
151
|
-
extraProviders?: Provider[];
|
|
152
|
-
credentials?: boolean | CredentialsOptions;
|
|
153
|
-
oauth?: boolean | OAuthOptions;
|
|
154
|
-
totp?: boolean | TOTPOptions;
|
|
155
|
-
anonymous?: boolean | AnonymousOptions;
|
|
156
|
-
magicLink?: boolean | MagicLinkOptions;
|
|
157
|
-
otp?: boolean | OTPOptions;
|
|
158
|
-
passkey?: boolean | PasskeyOptions;
|
|
159
|
-
onetap?: boolean | OneTapOptions;
|
|
160
|
-
sso?: boolean | SSOOptions;
|
|
161
|
-
/**
|
|
162
|
-
* Override the default authentication method for routes.
|
|
163
|
-
* If not set, AuthGuard uses the first enabled strategy.
|
|
164
|
-
*/
|
|
165
|
-
defaultAuthMethod?: AuthMethod;
|
|
166
|
-
rbac?: boolean | RBACOptions;
|
|
167
|
-
pbac?: boolean | PBACOptions;
|
|
168
|
-
session?: SessionOptions;
|
|
169
|
-
throttle?: ThrottleOptions;
|
|
170
|
-
global?: boolean;
|
|
171
|
-
}
|
|
172
|
-
export interface AuthModuleAsyncOptions {
|
|
173
|
-
useFactory: (...args: unknown[]) => Promise<AuthModuleOptions> | AuthModuleOptions;
|
|
174
|
-
inject?: (Type<unknown> | string | symbol)[];
|
|
175
|
-
imports?: DynamicModule['imports'];
|
|
176
|
-
extraProviders?: Provider[];
|
|
177
|
-
global?: boolean;
|
|
178
|
-
}
|
|
179
|
-
//# sourceMappingURL=auth.options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.options.d.ts","sourceRoot":"","sources":["../../packages/auth/auth.options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8DAA8D;IAC9D,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,m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OAAO,GAAG,aAAa,CAAC;IACjC,GAAG,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAG3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAG/B,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7B,IAAI,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAG7B,OAAO,CAAC,EAAE,cAAc,CAAC;IAGzB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAG3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;IACnF,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACnC,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.options.js","sourceRoot":"","sources":["../../packages/auth/auth.options.ts"],"names":[],"mappings":""}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { type ExecutionContext } from '@nestjs/common';
|
|
2
|
-
import type { IAuthResult, IAuthStrategy, ICacheService, ITokenPair } from './interfaces';
|
|
3
|
-
import { AuthMethod } from './interfaces';
|
|
4
|
-
import type { AuthModuleOptions } from './auth.options';
|
|
5
|
-
import { JwtService } from './session/jwt.service';
|
|
6
|
-
import { TokenBlacklistService } from './session/token-blacklist.service';
|
|
7
|
-
import { DeviceSessionService } from './session/device-session.service';
|
|
8
|
-
/**
|
|
9
|
-
* Central authentication orchestrator.
|
|
10
|
-
*
|
|
11
|
-
* Delegates to the appropriate strategy based on `AuthMethod`,
|
|
12
|
-
* manages token lifecycle, session tracking, and cache acceleration.
|
|
13
|
-
*/
|
|
14
|
-
export declare class AuthService {
|
|
15
|
-
private readonly options;
|
|
16
|
-
private readonly cache;
|
|
17
|
-
private readonly jwtService;
|
|
18
|
-
private readonly tokenBlacklist;
|
|
19
|
-
private readonly deviceSession;
|
|
20
|
-
private readonly strategyMap;
|
|
21
|
-
constructor(options: AuthModuleOptions, _strategies: IAuthStrategy[], cache: ICacheService, jwtService: JwtService, tokenBlacklist: TokenBlacklistService, deviceSession: DeviceSessionService);
|
|
22
|
-
/**
|
|
23
|
-
* Authenticate using the given method.
|
|
24
|
-
*
|
|
25
|
-
* @param method Authentication method (e.g. 'credentials', 'oauth')
|
|
26
|
-
* @param payload Strategy-specific payload
|
|
27
|
-
* @param context Optional execution context
|
|
28
|
-
*/
|
|
29
|
-
authenticate(method: AuthMethod, payload: Record<string, unknown>, context?: ExecutionContext): Promise<IAuthResult>;
|
|
30
|
-
/**
|
|
31
|
-
* Validate an access token and return its decoded payload.
|
|
32
|
-
* Uses cache for fast-path validation when available.
|
|
33
|
-
*
|
|
34
|
-
* @param token Raw JWT access token
|
|
35
|
-
*/
|
|
36
|
-
validateToken(token: string): Promise<Record<string, unknown>>;
|
|
37
|
-
/**
|
|
38
|
-
* Refresh an expired access token using a refresh token.
|
|
39
|
-
* Implements refresh token rotation.
|
|
40
|
-
*/
|
|
41
|
-
refreshToken(refreshToken: string, deviceId?: string): Promise<ITokenPair>;
|
|
42
|
-
/**
|
|
43
|
-
* Logout — blacklist the current access token and optionally
|
|
44
|
-
* remove a specific device session.
|
|
45
|
-
*/
|
|
46
|
-
logout(accessToken: string, deviceId?: string): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Logout from all devices — revoke all sessions for a user.
|
|
49
|
-
*/
|
|
50
|
-
logoutAll(userId: string): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Get all active sessions for a user (multi-device view).
|
|
53
|
-
*/
|
|
54
|
-
getUserSessions(userId: string): Promise<import("./session").IDeviceInfo[]>;
|
|
55
|
-
private hash;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=auth.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../packages/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;GAKG;AACH,qBACa,WAAW;IAKpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAIxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAXhC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;gBAIjD,OAAO,EAAE,iBAAiB,EAE3C,WAAW,EAAE,aAAa,EAAE,EAEX,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,qBAAqB,EACrC,aAAa,EAAE,oBAAoB;IAOtD;;;;;;OAMG;IACG,YAAY,CAChB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,W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