@canopy-io/nestjs 0.9.5 → 0.9.7
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 +16 -0
- package/README.md +12 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @canopy-io/nestjs
|
|
2
2
|
|
|
3
|
+
## 0.9.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [30c915c]
|
|
8
|
+
- @canopy-io/node@0.28.0
|
|
9
|
+
|
|
10
|
+
## 0.9.6
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- eaee2f6: Follows Canopy's release that gives Direct API tokens an audience: a Direct API access token names the id of the Environment that issued it in `aud`, as a Hosted Login token names its OAuth client. `TokenVerifier`'s `audience` (and `verify.audience` in `CanopyModule`) now takes a list as well as one value, and accepts a token whose `aud` includes any of them, so one verifier with `[clientId, environmentId]` accepts both sign-in kinds of one Environment and refuses a token for another client. A verifier with no `audience` still refuses a token that carries `aud` (`token.audience_unverified`), and its message now names what to set for each sign-in kind; a token with no `aud` is still refused when an audience is set. Machine tokens are still held to `serviceAudience` alone.
|
|
15
|
+
- Updated dependencies [f1fca62]
|
|
16
|
+
- Updated dependencies [eaee2f6]
|
|
17
|
+
- @canopy-io/node@0.27.0
|
|
18
|
+
|
|
3
19
|
## 0.9.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# @canopy-io/nestjs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Authorize a NestJS app's routes with [Canopy](https://canopy-io.com): a permission check becomes a decorator on the route instead of a call in every handler.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Which package
|
|
6
|
+
|
|
7
|
+
- **A NestJS app:** this package. It installs [`@canopy-io/node`](https://www.npmjs.com/package/@canopy-io/node) and hands you its client for everything the guard does not cover.
|
|
8
|
+
- **Any other server:** [`@canopy-io/node`](https://www.npmjs.com/package/@canopy-io/node).
|
|
6
9
|
|
|
7
10
|
## Install
|
|
8
11
|
|
|
@@ -165,7 +168,9 @@ CanopyModule.forRoot<AuthedRequest>({
|
|
|
165
168
|
apiKey: process.env.CANOPY_API_KEY,
|
|
166
169
|
verify: {
|
|
167
170
|
environmentId: process.env.CANOPY_ENVIRONMENT_ID,
|
|
168
|
-
|
|
171
|
+
// Hosted Login: your OAuth client id. Direct API: your Environment id.
|
|
172
|
+
// Both: list them.
|
|
173
|
+
audience: process.env.CANOPY_OAUTH_CLIENT_ID,
|
|
169
174
|
},
|
|
170
175
|
resolveIdentity: (request) => request.canopyToken?.sub,
|
|
171
176
|
});
|
|
@@ -390,11 +395,11 @@ A hit costs nothing. A miss reads from Canopy on the request path and holds an i
|
|
|
390
395
|
|
|
391
396
|
The read itself is deliberately **not** cancelled: it may be shared with other requests that are still waiting on it, and it warms the cache either way.
|
|
392
397
|
|
|
393
|
-
##
|
|
398
|
+
## Learn more
|
|
394
399
|
|
|
395
|
-
[
|
|
396
|
-
|
|
397
|
-
|
|
400
|
+
- [SDKs and Libraries](https://canopy-io.com/docs/sdks-and-libraries)
|
|
401
|
+
- [Authorization caching](https://canopy-io.com/docs/authorization-caching)
|
|
402
|
+
- [Changelog](./CHANGELOG.md): the package is pre-1.0, so a minor version may carry a breaking change. Read the entry before upgrading.
|
|
398
403
|
|
|
399
404
|
## License
|
|
400
405
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopy-io/nestjs",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "Official NestJS integration for Canopy \u2014 hierarchical identity and access management.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Canopy Identity Inc.",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"test:watch": "vitest"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@canopy-io/node": "^0.
|
|
65
|
+
"@canopy-io/node": "^0.28.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|