@ambushsoftworks/nestjs-auth-graphql 0.11.0 → 0.12.0
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/CHANGELOG.md +137 -0
- package/README.md +131 -3
- package/dist/auth.module.d.ts +6 -1
- package/dist/auth.module.d.ts.map +1 -1
- package/dist/auth.module.js +45 -12
- package/dist/auth.module.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/decorators/require-scopes.decorator.d.ts +2 -0
- package/dist/decorators/require-scopes.decorator.d.ts.map +1 -0
- package/dist/decorators/require-scopes.decorator.js +8 -0
- package/dist/decorators/require-scopes.decorator.js.map +1 -0
- package/dist/guards/csrf.guard.d.ts +2 -0
- package/dist/guards/csrf.guard.d.ts.map +1 -1
- package/dist/guards/csrf.guard.js +9 -2
- package/dist/guards/csrf.guard.js.map +1 -1
- package/dist/guards/scope.guard.d.ts +8 -0
- package/dist/guards/scope.guard.d.ts.map +1 -0
- package/dist/guards/scope.guard.js +53 -0
- package/dist/guards/scope.guard.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/api-key-repository.interface.d.ts +3 -0
- package/dist/interfaces/api-key-repository.interface.d.ts.map +1 -1
- package/dist/resolvers/base-auth.resolver.d.ts.map +1 -1
- package/dist/resolvers/base-auth.resolver.js +0 -15
- package/dist/resolvers/base-auth.resolver.js.map +1 -1
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +10 -3
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/verification.service.d.ts +2 -1
- package/dist/services/verification.service.d.ts.map +1 -1
- package/dist/services/verification.service.js +38 -8
- package/dist/services/verification.service.js.map +1 -1
- package/dist/strategies/api-key.strategy.d.ts +6 -1
- package/dist/strategies/api-key.strategy.d.ts.map +1 -1
- package/dist/strategies/api-key.strategy.js +40 -6
- package/dist/strategies/api-key.strategy.js.map +1 -1
- package/dist/strategies/external-jwt.strategy.d.ts +19 -0
- package/dist/strategies/external-jwt.strategy.d.ts.map +1 -0
- package/dist/strategies/external-jwt.strategy.js +124 -0
- package/dist/strategies/external-jwt.strategy.js.map +1 -0
- package/dist/strategies/jwt.strategy.d.ts.map +1 -1
- package/dist/strategies/jwt.strategy.js +1 -0
- package/dist/strategies/jwt.strategy.js.map +1 -1
- package/dist/utils/provider-helpers.d.ts +6 -0
- package/dist/utils/provider-helpers.d.ts.map +1 -1
- package/dist/utils/provider-helpers.js +4 -0
- package/dist/utils/provider-helpers.js.map +1 -1
- package/dist/utils/verification-base-url.d.ts +2 -0
- package/dist/utils/verification-base-url.d.ts.map +1 -0
- package/dist/utils/verification-base-url.js +19 -0
- package/dist/utils/verification-base-url.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,143 @@ for buried obligations. **The marker was introduced in 0.9.0 and has not been
|
|
|
27
27
|
retro-applied**, so it is reliable from 0.9.0 onward only. Convention adopted
|
|
28
28
|
from `@ambushsoftworks/nestjs-payments-graphql`.
|
|
29
29
|
|
|
30
|
+
## [0.12.0] - 2026-09-20
|
|
31
|
+
|
|
32
|
+
Ambush Desk asked for two things: verifying JWTs that other systems sign, and API
|
|
33
|
+
keys with scopes, expiry and prefixes. They also reported duplicate security
|
|
34
|
+
events, and checking that turned up a false one. Jobsites then filed two more:
|
|
35
|
+
a verification link that cannot follow a realm, and a password reset that
|
|
36
|
+
silently skips accounts it should not. See **Fixed**.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
- **Every signup, login and logout was logged twice.** `BaseAuthResolver` logged
|
|
40
|
+
`SIGNUP_SUCCESS`, `LOGIN_SUCCESS` and `LOGOUT_SUCCESS` after `AuthService` had
|
|
41
|
+
already logged each, so an `IAuthLogger` writing to an audit table stored two
|
|
42
|
+
rows per operation. `AuthService` keeps its copies: they also cover flows that
|
|
43
|
+
never reach the resolver. Reported by Ambush Desk, and reproduced end to end
|
|
44
|
+
before the fix.
|
|
45
|
+
- **A signup refused by `features.preventEnumerationOnSignup` logged
|
|
46
|
+
`SIGNUP_SUCCESS`** for an account that was never created, carrying the
|
|
47
|
+
synthetic response's random user ID. The resolver logged it without being able
|
|
48
|
+
to tell the signup apart from a real one; `AuthService`, which can, does not.
|
|
49
|
+
- **A password reset for an account with no password sent nothing, silently.**
|
|
50
|
+
Both `requestPasswordReset` and `resetPassword` tested `passwordHash == null`
|
|
51
|
+
and read it as "this user signed in with Google". It is also how an
|
|
52
|
+
operator-provisioned account starts, so an account created by an admin CLI
|
|
53
|
+
got no email — and the request returned the same generic success as a real
|
|
54
|
+
send, so the operator saw success for an account nobody could ever sign into.
|
|
55
|
+
Both guards now test for an actual social identity via the exported
|
|
56
|
+
`hasSocialIdentity(user)` (`googleId`, `facebookId` or `appleId`). A
|
|
57
|
+
social-only account behaves exactly as before. **The two guards have to agree**
|
|
58
|
+
— correcting only the first would email a credential the second refuses, which
|
|
59
|
+
is worse than the silence. A skip is now reported through `IAuthLogger` as
|
|
60
|
+
`PASSWORD_RESET_REQUESTED` with `result: 'SKIPPED_SOCIAL_ONLY'`; the public
|
|
61
|
+
response is deliberately unchanged, since `performRequestPasswordReset` is
|
|
62
|
+
reachable unauthenticated and a distinguishable return value would be an
|
|
63
|
+
enumeration oracle. Reported by jobsites.
|
|
64
|
+
- Consequence worth deciding on rather than discovering: a half-finished
|
|
65
|
+
signup row with no password and no social identity can now be claimed by
|
|
66
|
+
whoever controls the address. Previously it was unreachable, which is not
|
|
67
|
+
the same as safe.
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
- **`createExternalJwtStrategy(name, options | { inject, useFactory })`**: a
|
|
71
|
+
Passport strategy for JWTs another system signs, with
|
|
72
|
+
`secretProvider(kid, request)`, required `algorithms`, `issuer`, `audience`,
|
|
73
|
+
`clockToleranceSec`, `maxTokenBytes` (default 8192), `mapClaims` and
|
|
74
|
+
`jwtFromRequest`. Separate from the package's `jwt` strategy: no realm check
|
|
75
|
+
and no user lookup. Every rejection fails softly, so it composes in
|
|
76
|
+
`createAuthGuard`. Requested by Ambush Desk.
|
|
77
|
+
- Unsafe configuration fails boot: missing or empty `algorithms`, `none`, an
|
|
78
|
+
algorithm jsonwebtoken does not know, HMAC mixed with asymmetric families
|
|
79
|
+
(which lets a public key be used as an HMAC secret), or one of the package's
|
|
80
|
+
own strategy names.
|
|
81
|
+
- The `{ inject, useFactory }` form wires constructor injection, so
|
|
82
|
+
`secretProvider` can use application services without a subclass.
|
|
83
|
+
- **API key scopes**: `@RequireScopes(...)` and `ScopeGuard`, with
|
|
84
|
+
`IApiKeyAccount.scopes?: string[]`. A key needs every listed scope, and
|
|
85
|
+
otherwise gets 403 `INSUFFICIENT_SCOPE` naming what the operation requires. A
|
|
86
|
+
key with no `scopes` has none. Signed-in people pass, since their access is
|
|
87
|
+
`PermissionGuard`'s job. Requested by Ambush Desk.
|
|
88
|
+
- **API key expiry**: `IApiKeyAccount.expiresAt?: Date | null`. A key past it is
|
|
89
|
+
refused with `401 API key has expired`. Requested by Ambush Desk.
|
|
90
|
+
- **`apiKey.headerName`**, such as `'X-API-Key'`, read before
|
|
91
|
+
`Authorization: Bearer`, which keeps working. `CsrfGuard` treats a request
|
|
92
|
+
carrying it as credentialed, as it already does for `Authorization`. Requested
|
|
93
|
+
by Ambush Desk.
|
|
94
|
+
- **`apiKey.prefix`**, such as `'ait_'`. A token without it is not an API key and
|
|
95
|
+
goes to the next strategy with no lookup; one with it that matches no key is
|
|
96
|
+
refused with `401 Invalid API key`, since it cannot be a JWT. That replaces the
|
|
97
|
+
requested `onUnknownKey: 'fail' | 'error'` switch. Requested by Ambush Desk.
|
|
98
|
+
- **`IApiKeyRepository.touchLastUsed?(id)`**, called once per successful match
|
|
99
|
+
and never for a refused key. It is not awaited, and a failure is logged rather
|
|
100
|
+
than failing the request. Requested by Ambush Desk.
|
|
101
|
+
- **`verification.baseUrl` accepts a resolver**: `string | ((realm?: string) =>
|
|
102
|
+
string)`. One deployment serving several brands needs a link that opens on the
|
|
103
|
+
site the user came from; the realm already reached the credential and was
|
|
104
|
+
dropped one line before the URL. It applies to both verification modes, since
|
|
105
|
+
the token link and the code page link are built from the same resolved base.
|
|
106
|
+
Purely additive — a string behaves exactly as before. Requested by jobsites.
|
|
107
|
+
- Called once per link and synchronous: resolve from a map, not a query.
|
|
108
|
+
- Must return a URL for `realm === undefined` too — a request exempted by
|
|
109
|
+
`realm.skip`, or a single-realm deployment, has no realm.
|
|
110
|
+
- Boot validation is necessarily weaker for a resolver: it is probed once with
|
|
111
|
+
`undefined`, because there is no request at startup to supply a realm. A
|
|
112
|
+
per-realm value is checked when the link is built, where token mode throws
|
|
113
|
+
(the link carries the only copy of the credential) and code mode warns and
|
|
114
|
+
sends without a link (the code is in the body).
|
|
115
|
+
|
|
116
|
+
### Changed
|
|
117
|
+
- **The `jwt` strategy pins `algorithms: ['HS256']`**, the algorithm the module's
|
|
118
|
+
`JwtModule` signs with. Unpinned, jsonwebtoken 9 also accepted HS384 and HS512
|
|
119
|
+
tokens signed with `jwtSecret`. Tokens this package issues are unaffected.
|
|
120
|
+
- **`ApiKeyStrategy`'s constructor takes the `apiKey` options** as an optional
|
|
121
|
+
second argument. This matters only if you construct the strategy yourself.
|
|
122
|
+
|
|
123
|
+
### Declined
|
|
124
|
+
- **Publishable, origin-restricted API keys.** A key an app embeds is public by
|
|
125
|
+
construction: it identifies an app rather than authenticating anyone, and
|
|
126
|
+
`Origin` is set freely by any non-browser client, so restricting it is abuse
|
|
127
|
+
control rather than authentication. Keeping them out means every credential
|
|
128
|
+
this package accepts is a secret one. Requested by Ambush Desk, which keeps
|
|
129
|
+
ingest keys as its own concept.
|
|
130
|
+
|
|
131
|
+
### Documentation
|
|
132
|
+
- README: **External JWTs**; **API Key Authentication** extended with the prefix,
|
|
133
|
+
header, expiry, scopes and last-used tracking; `ScopeGuard` and
|
|
134
|
+
`@RequireScopes` in the guard and decorator tables; the new options; and
|
|
135
|
+
**Migrating to v0.12.0**.
|
|
136
|
+
- CLAUDE.md: **API Keys, Scopes and External JWTs**, and the rule that each
|
|
137
|
+
security event is logged once, by the layer that performs the action.
|
|
138
|
+
- README: **One API, several brands: `baseUrl` per realm**, the widened
|
|
139
|
+
`verification.baseUrl` row, and both new **Migrating to v0.12.0** notes.
|
|
140
|
+
- CLAUDE.md: base URL resolution is realm-aware through one seam, with the
|
|
141
|
+
warning not to answer it by handing the raw token to the email renderer; and
|
|
142
|
+
the rule that password reset tests for a social identity, never for a missing
|
|
143
|
+
password hash.
|
|
144
|
+
|
|
145
|
+
### Testing
|
|
146
|
+
- **End-to-end** (`test/e2e/tokens-and-keys.e2e-spec.ts`), on both NestJS majors:
|
|
147
|
+
a customer token through `createAuthGuard(['customer-jwt'])` on an HTTP route
|
|
148
|
+
and in a resolver, both guard orders with staff tokens, and refusals for
|
|
149
|
+
another algorithm, an unknown key ID, another audience and an expired token.
|
|
150
|
+
For API keys: a staff JWT accepted with a prefix set, a key in `X-API-Key` with
|
|
151
|
+
its use recorded, an unknown prefixed key, an expired key, `@RequireScopes`
|
|
152
|
+
against keys and people, and the CSRF skip.
|
|
153
|
+
- **Signup, login and logout now run end to end through `BaseAuthResolver`**,
|
|
154
|
+
counting the events each produces, including a signup refused by
|
|
155
|
+
`preventEnumerationOnSignup`.
|
|
156
|
+
- **Per-realm links**, in `auth.service.verification-mode.spec.ts` against a real
|
|
157
|
+
`VerificationService`, and end to end in `auth-module.e2e-spec.ts` — the realm
|
|
158
|
+
is attached by `RealmMiddleware`, so only an assembled app proves it survives
|
|
159
|
+
the whole path from header to emailed link. Each test parses the rendered URL
|
|
160
|
+
and feeds the credential back through `resetPassword`, rather than asserting
|
|
161
|
+
that a send happened.
|
|
162
|
+
- **43 mutation checks**, each reintroducing one defect: every one failed a test.
|
|
163
|
+
The five added here include reverting each password-reset guard separately —
|
|
164
|
+
reverting only `resetPassword` is caught by the close-the-loop test, which is
|
|
165
|
+
the half-fix worth guarding against.
|
|
166
|
+
|
|
30
167
|
## [0.11.0] - 2026-09-15
|
|
31
168
|
|
|
32
169
|
Ambush Desk asked for two things: refresh retries that survive a second API
|
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ Production-grade authentication module for NestJS GraphQL + REST APIs. JWT, cook
|
|
|
13
13
|
- [Multi-Tenancy](#multi-tenancy)
|
|
14
14
|
- [Realm-Based Identity Isolation](#realm-based-identity-isolation)
|
|
15
15
|
- [API Key Authentication](#api-key-authentication)
|
|
16
|
+
- [External JWTs](#external-jwts)
|
|
16
17
|
- [Email System](#email-system)
|
|
17
18
|
- [Verification Modes](#verification-modes)
|
|
18
19
|
- [OAuth](#oauth)
|
|
@@ -39,6 +40,7 @@ Production-grade authentication module for NestJS GraphQL + REST APIs. JWT, cook
|
|
|
39
40
|
- [GraphQL Subscriptions](#graphql-subscriptions)
|
|
40
41
|
- [Utilities](#utilities)
|
|
41
42
|
- [Security Features](#security-features)
|
|
43
|
+
- [Migrating to v0.12.0](#migrating-to-v0120)
|
|
42
44
|
- [Migrating to v0.11.0](#migrating-to-v0110)
|
|
43
45
|
- [Migrating to v0.10.0](#migrating-to-v0100)
|
|
44
46
|
- [Migrating to v0.9.0](#migrating-to-v090)
|
|
@@ -559,6 +561,73 @@ The `ApiKeyStrategy` hashes the bearer token with SHA-256 and calls `findByKeyHa
|
|
|
559
561
|
|
|
560
562
|
Before 0.10.0 the API key strategy rejected an unknown bearer token itself, which stopped the chain: `['api-key', 'jwt']` rejected every JWT.
|
|
561
563
|
|
|
564
|
+
#### Key options
|
|
565
|
+
|
|
566
|
+
| Option | Example | Effect |
|
|
567
|
+
|--------|---------|--------|
|
|
568
|
+
| `apiKey.headerName` | `'X-API-Key'` | A header carrying the raw key, read before `Authorization: Bearer`, which keeps working. `CsrfGuard` treats a request carrying it as credentialed, as it already does for `Authorization` |
|
|
569
|
+
| `apiKey.prefix` | `'ait_'` | The prefix every key you issue starts with. See below |
|
|
570
|
+
|
|
571
|
+
Both are read only with `apiKeyRepositoryInstance`, and `apiKey.prefix` without it warns at boot. `headerName` must be a header name other than `Authorization`, and `prefix` must not be empty -- an empty one matches every token, so every unknown bearer token, JWTs included, would be refused. Boot fails on either.
|
|
572
|
+
|
|
573
|
+
**A prefix makes an unknown key unambiguous.** Without one, the strategy cannot tell a mistyped key from a JWT:
|
|
574
|
+
|
|
575
|
+
| Token | Without `prefix` | With `prefix` |
|
|
576
|
+
|-------|------------------|---------------|
|
|
577
|
+
| Does not start with the prefix (a JWT, say) | Looked up, then passed to the next strategy | Passed to the next strategy, with no lookup |
|
|
578
|
+
| Starts with it, matches no key | Passed to the next strategy; a single-strategy guard answers a generic 401 | `401 Invalid API key` -- it cannot be a JWT, so no other strategy tries it |
|
|
579
|
+
| Matches a key | Authenticated, unless the key is inactive or expired | The same |
|
|
580
|
+
|
|
581
|
+
#### Expiry, scopes and last use
|
|
582
|
+
|
|
583
|
+
`IApiKeyAccount` carries optional `scopes?: string[]` and `expiresAt?: Date | null`, and `IApiKeyRepository` may implement `touchLastUsed?(id)`. Existing repositories keep working.
|
|
584
|
+
|
|
585
|
+
- **Expiry.** A key whose `expiresAt` has passed is refused with `401 API key has expired`, and no other strategy tries it. A key without one never expires.
|
|
586
|
+
- **Scopes.** Mark the operation and register `ScopeGuard` after your authentication guard:
|
|
587
|
+
|
|
588
|
+
```typescript
|
|
589
|
+
@Get('tickets')
|
|
590
|
+
@UseGuards(createAuthGuard(['api-key', 'jwt']), ScopeGuard)
|
|
591
|
+
@RequireScopes('tickets:read')
|
|
592
|
+
listTickets() { /* ... */ }
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
A key must hold every listed scope. One that does not gets 403 with `{ message: 'Insufficient scope', code: 'INSUFFICIENT_SCOPE', requiredScopes, statusCode: 403 }`, naming what the operation requires. A key with no `scopes` holds none. **Signed-in people pass**: scopes restrict keys, while a person's access is `PermissionGuard`'s job. With no authenticated principal at all, `ScopeGuard` answers 401 -- which is why it goes after the auth guard.
|
|
596
|
+
- **Last use.** `touchLastUsed(id)` is called once per successful match, and only then -- never for a key that is refused. It is not awaited: a failure is logged and never fails the request.
|
|
597
|
+
|
|
598
|
+
### External JWTs
|
|
599
|
+
|
|
600
|
+
`createExternalJwtStrategy(name, options)` verifies tokens another system signs -- each app's backend signing for its own users, say. It registers a separate Passport strategy under `name`, with no realm check and no user lookup, so the package's own `jwt` strategy is untouched.
|
|
601
|
+
|
|
602
|
+
```typescript
|
|
603
|
+
export const CustomerJwtStrategy = createExternalJwtStrategy('customer-jwt', {
|
|
604
|
+
inject: [AppSecretsService], // optional; pass a plain options object instead
|
|
605
|
+
useFactory: (secrets: AppSecretsService) => ({
|
|
606
|
+
algorithms: ['HS256'], // required
|
|
607
|
+
audience: 'ambush-desk',
|
|
608
|
+
secretProvider: (kid) => secrets.findSecret(kid),
|
|
609
|
+
mapClaims: (claims) => ({ id: claims.sub, app: claims.app, segments: claims.segments }),
|
|
610
|
+
}),
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
// providers: [CustomerJwtStrategy]
|
|
614
|
+
// @UseGuards(createAuthGuard(['customer-jwt']))
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
| Option | Default | Description |
|
|
618
|
+
|--------|---------|-------------|
|
|
619
|
+
| `secretProvider(kid, request)` | -- | The key that verifies a token: a shared secret for `HS*`, a PEM public key for `RS*`, `PS*` and `ES*`. May be async. `null` rejects the token; so does a throw, which is logged |
|
|
620
|
+
| `algorithms` | -- | **Required.** The algorithms the issuer signs with |
|
|
621
|
+
| `issuer`, `audience` | -- | Required `iss` / `aud`, when set |
|
|
622
|
+
| `clockToleranceSec` | `0` | Clock skew allowed on `exp` and `nbf` |
|
|
623
|
+
| `maxTokenBytes` | `8192` | A longer token is refused before anything parses it |
|
|
624
|
+
| `mapClaims(payload)` | the payload | Builds `request.user`, arrays and custom claims intact. `null`, `undefined` or a throw rejects the token |
|
|
625
|
+
| `jwtFromRequest(request)` | `Authorization: Bearer` | Where the token comes from |
|
|
626
|
+
|
|
627
|
+
**Algorithms are pinned, one family at a time.** Boot fails with `InvalidAuthConfigException` for missing or empty `algorithms`, for `none`, for an algorithm jsonwebtoken does not know, and for HMAC (`HS*`) mixed with asymmetric algorithms -- the mix that lets a public key be used as an HMAC secret. `'jwt'` and `'api-key'` are refused as names, since Passport would replace the package's own strategy.
|
|
628
|
+
|
|
629
|
+
**Every rejection fails softly**, so the strategy composes: `createAuthGuard(['customer-jwt', 'jwt'])` accepts either kind of token, in either order, and answers 401 when both fail.
|
|
630
|
+
|
|
562
631
|
### Email System
|
|
563
632
|
|
|
564
633
|
The email system uses a composable architecture: a **sender** (transport) and a **template renderer** (HTML generation).
|
|
@@ -688,6 +757,40 @@ variable (deprecated — logged once). With neither, code-mode emails carry no
|
|
|
688
757
|
link and nothing is logged: the code is in the body, so no link is needed. The
|
|
689
758
|
code itself is never placed in a query string in either mode.
|
|
690
759
|
|
|
760
|
+
#### One API, several brands: `baseUrl` per realm
|
|
761
|
+
|
|
762
|
+
With [realms](#realm-based-identity-isolation) enabled, one deployment serves
|
|
763
|
+
several frontends and a link must open on the site the user actually came from.
|
|
764
|
+
`baseUrl` accepts a resolver as well as a string; it is called with the realm of
|
|
765
|
+
the request the credential is being issued for:
|
|
766
|
+
|
|
767
|
+
```typescript
|
|
768
|
+
const SITES: Record<string, string> = {
|
|
769
|
+
'site-a': 'https://a.example.com',
|
|
770
|
+
'site-b': 'https://b.example.com',
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
verification: {
|
|
774
|
+
baseUrl: (realm?: string) => SITES[realm ?? ''] ?? 'https://www.example.com',
|
|
775
|
+
},
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
It applies to both modes — the token link and the code page link — because both
|
|
779
|
+
are built from the same resolved base. It is called once per link, so resolve
|
|
780
|
+
from a map rather than a query, and it must be synchronous.
|
|
781
|
+
|
|
782
|
+
**Boot validation is weaker for a resolver, by necessity.** A string is checked
|
|
783
|
+
in full at startup. A resolver is only called once, with `undefined`, so the
|
|
784
|
+
realm-less case is checked and a per-realm return value is not — there is no
|
|
785
|
+
request at startup to supply a realm. What it returns for a specific realm is
|
|
786
|
+
checked when the link is built, and the two modes differ exactly as they do
|
|
787
|
+
elsewhere: token mode throws, because the link carries the only copy of the
|
|
788
|
+
credential; code mode logs a warning and sends the email without a link,
|
|
789
|
+
because the code is in the body.
|
|
790
|
+
|
|
791
|
+
Returning a value for `realm === undefined` is required. A request exempted by
|
|
792
|
+
`realm.skip`, or a single-realm deployment, has no realm.
|
|
793
|
+
|
|
691
794
|
**Custom `IEmailService` implementations.** Both send methods receive the
|
|
692
795
|
credential and its URL, and the mode determines which one is actionable:
|
|
693
796
|
|
|
@@ -1020,6 +1123,8 @@ These sit beside `useFactory`, not in the object it returns.
|
|
|
1020
1123
|
| `bruteForce.ipRateLimit` | `{ maxAttempts, windowMs }` | -- | IP rate-limit policy for `checkIpRateLimit`. When set, `rateLimiterInstance` MUST also be provided explicitly (boot fails with `InvalidAuthConfigException` otherwise). See [IP Rate Limiting](#ip-rate-limiting). |
|
|
1021
1124
|
| `realm.skip` | `(path, request) => boolean` | -- | Requests that need no realm, such as health checks and webhooks. Read only with `realmExtractorInstance`. See [Realm-Based Identity Isolation](#realm-based-identity-isolation) |
|
|
1022
1125
|
| `refreshGracePeriodSeconds` | `number` | `10` | How long a retried refresh gets the same token pair. `0` turns retries off. See [Refresh Retries](#refresh-retries) |
|
|
1126
|
+
| `apiKey.headerName` | `string` | -- | A header carrying the raw API key, e.g. `'X-API-Key'`, read before `Authorization`. See [API Key Authentication](#api-key-authentication) |
|
|
1127
|
+
| `apiKey.prefix` | `string` | -- | The prefix every API key you issue starts with, e.g. `'ait_'`. Makes an unknown key unambiguous. See [API Key Authentication](#api-key-authentication) |
|
|
1023
1128
|
|
|
1024
1129
|
### Feature Flags (`features`)
|
|
1025
1130
|
|
|
@@ -1094,7 +1199,7 @@ When `email` is provided, it takes precedence over `emailServiceInstance`.
|
|
|
1094
1199
|
|--------|------|---------|-------------|
|
|
1095
1200
|
| `tokenLength` | `number` | `64` | Token length in bytes (token mode) |
|
|
1096
1201
|
| `tokenExpiresInMinutes` | `number` | `60` | Token expiration (token mode) |
|
|
1097
|
-
| `baseUrl` | `string` |
|
|
1202
|
+
| `baseUrl` | `string \| (realm?: string) => string` | — | Absolute http(s) base URL for verification/reset links, or a resolver called with the request's realm. **Required when `verificationMode` is `'token'`** (validated at boot); optional in code mode |
|
|
1098
1203
|
|
|
1099
1204
|
### Optional Instance Options
|
|
1100
1205
|
|
|
@@ -1126,6 +1231,7 @@ When `email` is provided, it takes precedence over `emailServiceInstance`.
|
|
|
1126
1231
|
| `@PublicEndpoint()` | Method/Class | Skip authentication + tenant resolution (combines `@Public()` + `@SkipTenant()`) |
|
|
1127
1232
|
| `@SkipTenant()` | Method/Class | Skip tenant resolution |
|
|
1128
1233
|
| `@RequirePermissions('p1', 'p2')` | Method/Class | Require specific permissions |
|
|
1234
|
+
| `@RequireScopes('s1', 's2')` | Method/Class | Require API key scopes, enforced by `ScopeGuard`. People are unaffected. See [API Key Authentication](#api-key-authentication) |
|
|
1129
1235
|
| `@CurrentUser()` | Parameter | Inject authenticated user |
|
|
1130
1236
|
| `@CurrentTenant()` | Parameter | Inject resolved tenant context |
|
|
1131
1237
|
| `@CurrentRealm()` | Parameter | Inject resolved realm from request context |
|
|
@@ -1139,6 +1245,7 @@ When `email` is provided, it takes precedence over `emailServiceInstance`.
|
|
|
1139
1245
|
| `CsrfGuard` | CSRF header validation for cookie auth |
|
|
1140
1246
|
| `TenantGuard` | Multi-tenant context resolution |
|
|
1141
1247
|
| `PermissionGuard` | Permission checking against tenant context |
|
|
1248
|
+
| `ScopeGuard` | `@RequireScopes()` enforcement for API keys; register it after the authentication guard |
|
|
1142
1249
|
| `JwtAuthGuard` | JWT-only guard for GraphQL and HTTP routes (prefer `createAuthGuard` for several strategies or `@Public()`) |
|
|
1143
1250
|
|
|
1144
1251
|
### Recommended Guard Chains
|
|
@@ -1149,8 +1256,9 @@ When realm support is enabled, `RealmMiddleware` runs before all guards (as Nest
|
|
|
1149
1256
|
// JWT only
|
|
1150
1257
|
{ provide: APP_GUARD, useClass: createAuthGuard(['jwt'], { allowPublic: true }) }
|
|
1151
1258
|
|
|
1152
|
-
// JWT + API keys
|
|
1153
|
-
{ provide: APP_GUARD, useClass: createAuthGuard(['jwt', 'api-key'], { allowPublic: true }) }
|
|
1259
|
+
// JWT + API keys, with scopes enforced on the keys
|
|
1260
|
+
{ provide: APP_GUARD, useClass: createAuthGuard(['jwt', 'api-key'], { allowPublic: true }) },
|
|
1261
|
+
{ provide: APP_GUARD, useClass: ScopeGuard },
|
|
1154
1262
|
|
|
1155
1263
|
// Full stack with cookie auth + multi-tenancy
|
|
1156
1264
|
{ provide: APP_GUARD, useClass: CsrfGuard },
|
|
@@ -1231,8 +1339,28 @@ export class CustomGuard implements CanActivate {
|
|
|
1231
1339
|
- **`__Host-` cookie prefix** support for enhanced cookie security
|
|
1232
1340
|
- **Separate HMAC secrets** for refresh tokens, verification codes, and OAuth state
|
|
1233
1341
|
- **Realm-based identity isolation** with JWT realm claim validation, realm-scoped rate limiting and lockout, and auth flows that refuse a request without a realm
|
|
1342
|
+
- **Pinned JWT algorithms** -- the package's own `jwt` strategy verifies `HS256` only, and `createExternalJwtStrategy` requires an explicit `algorithms` list from one family (see [External JWTs](#external-jwts))
|
|
1343
|
+
- **API keys with scopes and expiry**, refused hard when they carry your prefix and match no key, so no other strategy accepts them
|
|
1234
1344
|
- **No raw personal data in package logs** — log lines use the user ID or a salted hash (`emailHash=`, `ipHash=`, under `AUTH_IP_HASH_SALT` or `jwtSecret`), phone numbers keep only their last two digits, and the default `ConsoleAuthLogger` redacts security-event metadata. A custom `authLoggerInstance` receives the raw fields; pass them through `redactSecurityEventMetadata` to store them redacted.
|
|
1235
1345
|
|
|
1346
|
+
## Migrating to v0.12.0
|
|
1347
|
+
|
|
1348
|
+
**Password reset now reaches accounts that have no password and no social login.** The guard on `requestPasswordReset` and `resetPassword` tested `passwordHash == null` and treated it as "this user signed in with Google". That is also how an operator-provisioned account starts, so an account created by an admin CLI was skipped silently — the request returned the same success message as a real send, and the reset would have been refused even if a code had arrived. Both guards now test for an actual social identity (`googleId`, `facebookId` or `appleId`), so a social-only account behaves exactly as before, and a password-less account with no social identity receives a reset code and can redeem it.
|
|
1349
|
+
|
|
1350
|
+
Two consequences worth deciding on rather than discovering. A half-finished signup row with no password and no social identity can now be claimed by whoever controls the address — previously it was unreachable, which is not the same as safe. And if you wrote a placeholder password hash to work around the old behaviour, you can drop it; `hasSocialIdentity` is exported if you want the same predicate.
|
|
1351
|
+
|
|
1352
|
+
The public response is unchanged in both cases. `requestPasswordReset` still returns the same generic message whether it sent, skipped or found nothing, because it is reachable unauthenticated and anything else would be an enumeration oracle. A skip is reported to your `IAuthLogger` instead, as `PASSWORD_RESET_REQUESTED` with `result: 'SKIPPED_SOCIAL_ONLY'`.
|
|
1353
|
+
|
|
1354
|
+
**`verification.baseUrl` accepts a resolver.** Purely additive — a string behaves exactly as before. See [`baseUrl` per realm](#one-api-several-brands-baseurl-per-realm).
|
|
1355
|
+
|
|
1356
|
+
**The `jwt` strategy now pins `HS256`.** That is the algorithm `JwtModule` signs with, so every token this package issues keeps working. A token signed with `jwtSecret` under HS384 or HS512 -- which jsonwebtoken accepted while nothing was pinned -- is now rejected. If another system mints tokens for the `jwt` strategy, check that it signs HS256, or give it its own strategy with [`createExternalJwtStrategy`](#external-jwts).
|
|
1357
|
+
|
|
1358
|
+
**Each security event is logged once.** `BaseAuthResolver` logged `SIGNUP_SUCCESS`, `LOGIN_SUCCESS` and `LOGOUT_SUCCESS` on top of `AuthService`, so an `IAuthLogger` writing to an audit table stored two rows per signup, login and logout. The service's copy is the one that remains: it also covers flows that never reach the resolver. Counts built on those events halve, and `LOGOUT_SUCCESS` metadata is now `{ userId }` -- the resolver's copy also carried `email`. `SIGNUP_ATTEMPT` and `LOGOUT_ALL`, which only the resolver logs, are unchanged.
|
|
1359
|
+
|
|
1360
|
+
**A signup refused by `features.preventEnumerationOnSignup` no longer logs `SIGNUP_SUCCESS`.** It used to log one, with the synthetic response's random user ID, for an account that was never created.
|
|
1361
|
+
|
|
1362
|
+
**API keys.** Nothing changes until you set `apiKey.prefix` or `apiKey.headerName`, or store `scopes` / `expiresAt`. `ApiKeyStrategy`'s constructor takes the `apiKey` options as an optional second argument, which matters only if you construct it yourself.
|
|
1363
|
+
|
|
1236
1364
|
## Migrating to v0.11.0
|
|
1237
1365
|
|
|
1238
1366
|
**`getRequestFromContext` may return `undefined`.** It now also finds a `graphql-ws` subscription's upgrade request, and returns `undefined` where there is no request at all. TypeScript flags each call that assumes a request. In a guard that cannot decide without one, use `requireRequestFromContext`.
|
package/dist/auth.module.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ export interface AuthModuleOptions {
|
|
|
56
56
|
resourcePermissionRepositoryInstance?: IResourcePermissionRepository;
|
|
57
57
|
jwtPayloadFactoryInstance?: IJwtPayloadFactory;
|
|
58
58
|
apiKeyRepositoryInstance?: IApiKeyRepository;
|
|
59
|
+
apiKey?: {
|
|
60
|
+
headerName?: string;
|
|
61
|
+
prefix?: string;
|
|
62
|
+
};
|
|
59
63
|
jwtValidation?: 'full' | 'payload-only';
|
|
60
64
|
isUserActive?: (user: IAuthUser) => boolean;
|
|
61
65
|
bcryptRounds?: number;
|
|
@@ -120,9 +124,10 @@ export interface AuthModuleOptions {
|
|
|
120
124
|
verification?: {
|
|
121
125
|
tokenLength?: number;
|
|
122
126
|
tokenExpiresInMinutes?: number;
|
|
123
|
-
baseUrl?: string;
|
|
127
|
+
baseUrl?: string | VerificationBaseUrlResolver;
|
|
124
128
|
};
|
|
125
129
|
}
|
|
130
|
+
export type VerificationBaseUrlResolver = (realm?: string) => string;
|
|
126
131
|
export interface AuthModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
127
132
|
useFactory: (...args: any[]) => Promise<AuthModuleOptions> | AuthModuleOptions;
|
|
128
133
|
inject?: any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAElB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA0B3D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAYjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uDAAuD,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"m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AAU,EAAE,CACV,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,OAAO,CAAC,iBAAiB,CAAC,GAAG,iBAAiB,CAAC;IACpD,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IAef,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAgCD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAyCvE;AA2ED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAwB7E;AASD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE,CA0BxE;AAWD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAsB1E;AAsKD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAuCrB,qBACa,UAAW,YAAW,UAAU;IAC3C,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAkC7C,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa;CAwZpE"}
|
package/dist/auth.module.js
CHANGED
|
@@ -40,12 +40,14 @@ const noop_email_service_1 = require("./services/noop-email.service");
|
|
|
40
40
|
const noop_sms_service_1 = require("./services/noop-sms.service");
|
|
41
41
|
const tenant_guard_1 = require("./guards/tenant.guard");
|
|
42
42
|
const permission_guard_1 = require("./guards/permission.guard");
|
|
43
|
+
const scope_guard_1 = require("./guards/scope.guard");
|
|
43
44
|
const api_key_strategy_1 = require("./strategies/api-key.strategy");
|
|
44
45
|
const default_jwt_payload_factory_1 = require("./services/default-jwt-payload-factory");
|
|
45
46
|
const constants_1 = require("./constants");
|
|
46
47
|
const in_memory_rate_limiter_service_1 = require("./services/in-memory-rate-limiter.service");
|
|
47
48
|
const in_memory_refresh_retry_cache_1 = require("./services/in-memory-refresh-retry-cache");
|
|
48
49
|
const invalid_auth_config_exception_1 = require("./exceptions/invalid-auth-config.exception");
|
|
50
|
+
const verification_base_url_1 = require("./utils/verification-base-url");
|
|
49
51
|
const configurable_email_service_1 = require("./services/configurable-email.service");
|
|
50
52
|
const default_email_template_renderer_1 = require("./services/default-email-template-renderer");
|
|
51
53
|
function validateAuthModuleOptions(opts) {
|
|
@@ -53,6 +55,7 @@ function validateAuthModuleOptions(opts) {
|
|
|
53
55
|
validateRealmOptions(opts);
|
|
54
56
|
validateRefreshRetryOptions(opts);
|
|
55
57
|
validateCsrfOptions(opts);
|
|
58
|
+
validateApiKeyOptions(opts);
|
|
56
59
|
const ipRateLimit = opts.bruteForce?.ipRateLimit;
|
|
57
60
|
if (ipRateLimit && !opts.rateLimiterInstance) {
|
|
58
61
|
throw new invalid_auth_config_exception_1.InvalidAuthConfigException('[AuthModule] bruteForce.ipRateLimit is configured but rateLimiterInstance ' +
|
|
@@ -138,6 +141,10 @@ function describeIgnoredOptions(opts) {
|
|
|
138
141
|
'which is not set, so no request is asked for a realm and none needs skipping. ' +
|
|
139
142
|
'Remove realm.skip, or set realmExtractorInstance.');
|
|
140
143
|
}
|
|
144
|
+
if (opts.apiKey?.prefix !== undefined && !opts.apiKeyRepositoryInstance) {
|
|
145
|
+
messages.push('[AuthModule] apiKey.prefix is ignored: API key authentication is enabled by ' +
|
|
146
|
+
'`apiKeyRepositoryInstance`, which is not set. Remove it, or set apiKeyRepositoryInstance.');
|
|
147
|
+
}
|
|
141
148
|
if (opts.refreshRetryCacheInstance && opts.refreshGracePeriodSeconds === 0) {
|
|
142
149
|
messages.push('[AuthModule] refreshRetryCacheInstance is ignored: refreshGracePeriodSeconds is 0, ' +
|
|
143
150
|
'which turns refresh retries off. Remove one of the two.');
|
|
@@ -160,6 +167,20 @@ function describeInMemoryDefaults(opts) {
|
|
|
160
167
|
}
|
|
161
168
|
return messages;
|
|
162
169
|
}
|
|
170
|
+
function validateApiKeyOptions(opts) {
|
|
171
|
+
const headerName = opts.apiKey?.headerName;
|
|
172
|
+
if (headerName !== undefined &&
|
|
173
|
+
(typeof headerName !== 'string' ||
|
|
174
|
+
!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(headerName) ||
|
|
175
|
+
headerName.toLowerCase() === 'authorization')) {
|
|
176
|
+
throw new invalid_auth_config_exception_1.InvalidAuthConfigException(`[AuthModule] apiKey.headerName must be a header name other than Authorization (which is always ` +
|
|
177
|
+
`read), e.g. 'X-API-Key'; received ${JSON.stringify(headerName)}.`);
|
|
178
|
+
}
|
|
179
|
+
const prefix = opts.apiKey?.prefix;
|
|
180
|
+
if (prefix !== undefined && (typeof prefix !== 'string' || prefix === '')) {
|
|
181
|
+
throw new invalid_auth_config_exception_1.InvalidAuthConfigException(`[AuthModule] apiKey.prefix must be a non-empty string, e.g. 'ait_'; received ${JSON.stringify(prefix)}.`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
163
184
|
function validateCsrfOptions(opts) {
|
|
164
185
|
const webSocket = opts.csrf?.webSocket;
|
|
165
186
|
if (webSocket === undefined || webSocket === 'reject' || webSocket === 'skip') {
|
|
@@ -199,22 +220,32 @@ function validateVerificationOptions(opts) {
|
|
|
199
220
|
'is not set. Token-mode emails contain a link and no readable code, so ' +
|
|
200
221
|
'without a base URL every verification and password-reset email would be ' +
|
|
201
222
|
'unusable. Set verification.baseUrl to the absolute URL of your frontend ' +
|
|
202
|
-
"(e.g. 'https://app.example.com')
|
|
203
|
-
'/reset-password with `token` and `email`
|
|
204
|
-
"6-digit codes instead, set
|
|
223
|
+
"(e.g. 'https://app.example.com'), or to a resolver taking the realm; the " +
|
|
224
|
+
'package appends /verify-email and /reset-password with `token` and `email` ' +
|
|
225
|
+
"query parameters. To keep using 6-digit codes instead, set " +
|
|
226
|
+
"features.verificationMode to 'code'.");
|
|
227
|
+
}
|
|
228
|
+
if (typeof baseUrl === 'string') {
|
|
229
|
+
(0, verification_base_url_1.assertUsableBaseUrl)(baseUrl, 'verification.baseUrl');
|
|
230
|
+
return;
|
|
205
231
|
}
|
|
206
|
-
let
|
|
232
|
+
let probed;
|
|
207
233
|
try {
|
|
208
|
-
|
|
234
|
+
probed = baseUrl(undefined);
|
|
209
235
|
}
|
|
210
|
-
catch {
|
|
211
|
-
throw new invalid_auth_config_exception_1.InvalidAuthConfigException(
|
|
212
|
-
|
|
236
|
+
catch (error) {
|
|
237
|
+
throw new invalid_auth_config_exception_1.InvalidAuthConfigException('[AuthModule] verification.baseUrl is a resolver that threw when called ' +
|
|
238
|
+
`with no realm: ${error instanceof Error ? error.message : String(error)}. ` +
|
|
239
|
+
'It must return an absolute URL for every request, including one with no ' +
|
|
240
|
+
'realm — realm.skip exempts requests, and a single-realm deployment has ' +
|
|
241
|
+
'none at all.');
|
|
213
242
|
}
|
|
214
|
-
if (
|
|
215
|
-
throw new invalid_auth_config_exception_1.InvalidAuthConfigException(
|
|
216
|
-
|
|
243
|
+
if (typeof probed !== 'string' || probed.length === 0) {
|
|
244
|
+
throw new invalid_auth_config_exception_1.InvalidAuthConfigException('[AuthModule] verification.baseUrl is a resolver that returned ' +
|
|
245
|
+
`${probed === undefined ? 'undefined' : JSON.stringify(probed)} when called ` +
|
|
246
|
+
'with no realm. It must return an absolute http(s) URL string.');
|
|
217
247
|
}
|
|
248
|
+
(0, verification_base_url_1.assertUsableBaseUrl)(probed, 'verification.baseUrl (resolver called with no realm)');
|
|
218
249
|
}
|
|
219
250
|
var constants_2 = require("./constants");
|
|
220
251
|
Object.defineProperty(exports, "AUTH_MODULE_OPTIONS", { enumerable: true, get: function () { return constants_2.AUTH_MODULE_OPTIONS; } });
|
|
@@ -488,12 +519,13 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
488
519
|
if (!options.apiKeyRepositoryInstance) {
|
|
489
520
|
return null;
|
|
490
521
|
}
|
|
491
|
-
return new api_key_strategy_1.ApiKeyStrategy(options.apiKeyRepositoryInstance);
|
|
522
|
+
return new api_key_strategy_1.ApiKeyStrategy(options.apiKeyRepositoryInstance, options.apiKey);
|
|
492
523
|
},
|
|
493
524
|
},
|
|
494
525
|
realm_middleware_1.RealmMiddleware,
|
|
495
526
|
tenant_guard_1.TenantGuard,
|
|
496
527
|
permission_guard_1.PermissionGuard,
|
|
528
|
+
scope_guard_1.ScopeGuard,
|
|
497
529
|
],
|
|
498
530
|
exports: [
|
|
499
531
|
constants_1.AUTH_MODULE_OPTIONS,
|
|
@@ -517,6 +549,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
517
549
|
constants_1.API_KEY_REPOSITORY,
|
|
518
550
|
tenant_guard_1.TenantGuard,
|
|
519
551
|
permission_guard_1.PermissionGuard,
|
|
552
|
+
scope_guard_1.ScopeGuard,
|
|
520
553
|
jwt_1.JwtModule,
|
|
521
554
|
passport_1.PassportModule,
|
|
522
555
|
],
|
package/dist/auth.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAuuBA,8DAwCC;AA2ED,kEAwBC;AASD,wDAmBC;AAWD,4DAsBC;AA/6BD,2CAOwB;AACxB,oEAAgE;AAChE,qCAAwC;AACxC,+CAAkD;AAIlD,0DAAsD;AACtD,4EAAuE;AACvE,0EAAsE;AACtE,sEAAkE;AAClE,wEAAmE;AACnE,8FAAwF;AAExF,8EAAyE;AAEzE,8FAAyF;AACzF,wFAAkF;AAGlF,4DAAwD;AACxD,kEAA8D;AAC9D,sEAAkE;AAClE,4EAAuE;AACvE,gFAA2E;AAG3E,mEAA+D;AAe/D,8FAAyF;AACzF,4FAAsF;AACtF,wFAAmF;AACnF,8EAAsE;AACtE,yDAA+D;AAC/D,sEAAiE;AACjE,kE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_REPOSITORY = "API_KEY_REPOSITORY";
|
|
|
17
17
|
export declare const TENANT_HEADER_NAME = "TENANT_HEADER_NAME";
|
|
18
18
|
export declare const REALM_EXTRACTOR = "REALM_EXTRACTOR";
|
|
19
19
|
export declare const PERMISSIONS_KEY = "permissions";
|
|
20
|
+
export declare const SCOPES_KEY = "scopes";
|
|
20
21
|
export declare const SKIP_TENANT_KEY = "skipTenant";
|
|
21
22
|
export declare const PUBLIC_ENDPOINT_KEY = "isPublicEndpoint";
|
|
22
23
|
export declare const RESOURCE_SCOPE_KEY = "resourceScope";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAMzD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAMjD,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAMnE,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAM7C,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAMzC,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAM3D,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAMjE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAM/D,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAO3D,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAOzC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAU3C,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAMrD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAMnD,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAM/E,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AAMzD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAMvD,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAWvD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAOjD,eAA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BAAmB,qBAAqB,CAAC;AAGtD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAUlD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAM7D,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AAMrE,eAAO,MAAM,qBAAqB,0BAA0B,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.USER_REPOSITORY_PHONE = exports.USER_REPOSITORY_BIOMETRIC = exports.USER_REPOSITORY_OAUTH = exports.RESOURCE_SCOPE_KEY = exports.PUBLIC_ENDPOINT_KEY = exports.SKIP_TENANT_KEY = exports.PERMISSIONS_KEY = exports.REALM_EXTRACTOR = exports.TENANT_HEADER_NAME = exports.API_KEY_REPOSITORY = exports.JWT_PAYLOAD_FACTORY = exports.RESOURCE_PERMISSION_REPOSITORY = exports.TENANT_EXTRACTOR = exports.TENANT_REPOSITORY = exports.RATE_LIMITER = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
3
|
+
exports.USER_REPOSITORY_PHONE = exports.USER_REPOSITORY_BIOMETRIC = exports.USER_REPOSITORY_OAUTH = exports.RESOURCE_SCOPE_KEY = exports.PUBLIC_ENDPOINT_KEY = exports.SKIP_TENANT_KEY = exports.SCOPES_KEY = exports.PERMISSIONS_KEY = exports.REALM_EXTRACTOR = exports.TENANT_HEADER_NAME = exports.API_KEY_REPOSITORY = exports.JWT_PAYLOAD_FACTORY = exports.RESOURCE_PERMISSION_REPOSITORY = exports.TENANT_EXTRACTOR = exports.TENANT_REPOSITORY = exports.RATE_LIMITER = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
4
4
|
exports.AUTH_MODULE_OPTIONS = 'AUTH_MODULE_OPTIONS';
|
|
5
5
|
exports.USER_REPOSITORY = 'USER_REPOSITORY';
|
|
6
6
|
exports.REFRESH_TOKEN_REPOSITORY = 'REFRESH_TOKEN_REPOSITORY';
|
|
@@ -20,6 +20,7 @@ exports.API_KEY_REPOSITORY = 'API_KEY_REPOSITORY';
|
|
|
20
20
|
exports.TENANT_HEADER_NAME = 'TENANT_HEADER_NAME';
|
|
21
21
|
exports.REALM_EXTRACTOR = 'REALM_EXTRACTOR';
|
|
22
22
|
exports.PERMISSIONS_KEY = 'permissions';
|
|
23
|
+
exports.SCOPES_KEY = 'scopes';
|
|
23
24
|
exports.SKIP_TENANT_KEY = 'skipTenant';
|
|
24
25
|
exports.PUBLIC_ENDPOINT_KEY = 'isPublicEndpoint';
|
|
25
26
|
exports.RESOURCE_SCOPE_KEY = 'resourceScope';
|