@canopy-io/nestjs 0.3.0 → 0.3.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +3 -0
  3. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @canopy-io/nestjs
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 66415c2: The NestJS README's first `CanopyModule.forRoot` example now includes the required `verify` option, and `@canopy-io/node`'s types are regenerated from the published spec, adding the `branding.view` and `branding.manage` API key scopes. No behaviour changes.
8
+ - Updated dependencies [66415c2]
9
+ - @canopy-io/node@0.7.2
10
+
3
11
  ## 0.3.0
4
12
 
5
13
  ### Minor Changes
package/README.md CHANGED
@@ -34,6 +34,7 @@ import { CanopyModule } from "@canopy-io/nestjs";
34
34
  imports: [
35
35
  CanopyModule.forRoot<AuthedRequest>({
36
36
  apiKey: process.env.CANOPY_API_KEY,
37
+ verify: { environmentId: process.env.CANOPY_ENVIRONMENT_ID },
37
38
  resolveIdentity: (request) => request.user?.sub,
38
39
  resolveNode: (request) => request.params?.orgId,
39
40
  }),
@@ -42,6 +43,8 @@ import { CanopyModule } from "@canopy-io/nestjs";
42
43
  export class AppModule {}
43
44
  ```
44
45
 
46
+ `verify` names the Environment whose tokens the module accepts (`environmentId`, or `issuer` on a custom auth domain or a self-hosted instance). It is required: the module builds its token verifier at startup.
47
+
45
48
  The two resolvers are how the guard learns _who_ is asking and _where_. Where those live is your application's business — a claim on a verified token, a route parameter, a tenant on the session — so you supply them rather than the library guessing. Pass your own request type to `forRoot` and both resolvers are typed against it.
46
49
 
47
50
  When the key comes from something injectable, use `forRootAsync`:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canopy-io/nestjs",
3
- "version": "0.3.0",
4
- "description": "Official NestJS integration for Canopy — hierarchical identity and access management.",
3
+ "version": "0.3.1",
4
+ "description": "Official NestJS integration for Canopy \u2014 hierarchical identity and access management.",
5
5
  "license": "MIT",
6
6
  "author": "Canopy Identity Inc.",
7
7
  "homepage": "https://github.com/canopy-identity/canopy-javascript#readme",
@@ -62,7 +62,7 @@
62
62
  "test:watch": "vitest"
63
63
  },
64
64
  "dependencies": {
65
- "@canopy-io/node": "^0.7.0"
65
+ "@canopy-io/node": "^0.7.2"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@nestjs/common": "^10.0.0 || ^11.0.0",
@@ -70,12 +70,12 @@
70
70
  "reflect-metadata": "^0.1.13 || ^0.2.0"
71
71
  },
72
72
  "devDependencies": {
73
- "@nestjs/common": "^11.1.21",
74
- "@nestjs/core": "^11.1.21",
75
- "@nestjs/platform-express": "^11.1.28",
76
- "@nestjs/platform-fastify": "^11.1.28",
77
- "@nestjs/testing": "^11.1.21",
78
- "reflect-metadata": "^0.2.2",
79
- "rxjs": "^7.8.1"
73
+ "@nestjs/common": "11.2.7",
74
+ "@nestjs/core": "11.2.7",
75
+ "@nestjs/platform-express": "11.2.7",
76
+ "@nestjs/platform-fastify": "11.2.7",
77
+ "@nestjs/testing": "11.2.7",
78
+ "reflect-metadata": "0.2.2",
79
+ "rxjs": "7.8.2"
80
80
  }
81
81
  }