@canopy-io/nestjs 0.9.5 → 0.9.6

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @canopy-io/nestjs
2
2
 
3
+ ## 0.9.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 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.
8
+ - Updated dependencies [f1fca62]
9
+ - Updated dependencies [eaee2f6]
10
+ - @canopy-io/node@0.27.0
11
+
3
12
  ## 0.9.5
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # @canopy-io/nestjs
2
2
 
3
- Official NestJS integration for [Canopy](https://canopy-io.com) — hierarchical identity and access management for B2B SaaS.
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
- Turns a permission check into a decorator on the route instead of a call in every handler.
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
- audience: process.env.CANOPY_OAUTH_CLIENT_ID, // omit for Direct API
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
- ## Changelog
398
+ ## Learn more
394
399
 
395
- [CHANGELOG.md](./CHANGELOG.md) records every published version. The package is
396
- pre-1.0: while the surface is still settling, a minor bump may carry a breaking
397
- change, so read the entry before taking one.
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.5",
3
+ "version": "0.9.6",
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.26.0"
65
+ "@canopy-io/node": "^0.27.0"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@nestjs/common": "^10.0.0 || ^11.0.0",