@canopy-io/nestjs 0.9.0 → 0.9.2
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 +10 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @canopy-io/nestjs
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bd162f7: Document verifying tokens when a backend reaches Canopy at a different address than the one its tokens name: `issuer` as the token's `iss` reads, with `jwksUri` at the address the backend can reach, which must be a loopback address or a `*.localhost` name because Canopy refuses any other hostname. The agent skill also says a backend relaying the passkey sign-in calls sends no `Origin` header, since forwarding the browser's is refused with `403 auth.origin_not_allowed`.
|
|
8
|
+
- Updated dependencies [7b022e1]
|
|
9
|
+
- Updated dependencies [bd162f7]
|
|
10
|
+
- @canopy-io/node@0.23.4
|
|
11
|
+
|
|
12
|
+
## 0.9.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [739ee6b]
|
|
17
|
+
- @canopy-io/node@0.23.0
|
|
18
|
+
|
|
3
19
|
## 0.9.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -50,6 +50,16 @@ Register it once, in the root module. `isGlobal: true` makes its providers visib
|
|
|
50
50
|
|
|
51
51
|
`verify` names the Environment whose tokens the module accepts (`environmentId`, or `issuer` on a custom auth domain or a self-hosted instance; a self-hosted instance can instead set `CANOPY_BASE_URL` for the process, which `environmentId` and the client both follow). It is required: the module builds its token verifier at startup.
|
|
52
52
|
|
|
53
|
+
When your backend reaches Canopy at a different address than the one its tokens name, such as a container using an internal hostname, the issuer derived from `CANOPY_BASE_URL` is not the one the tokens carry and every sign-in is refused. Give `verify` both halves: `issuer` exactly as the token's `iss` reads, and `jwksUri` at the address your backend can reach. Canopy serves the signing keys only on its own hosts (the address its tokens name, a loopback address or a `*.localhost` name); any other hostname, such as a Docker service name, answers `404` with `auth.domain_host_not_served`.
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
verify: {
|
|
57
|
+
issuer: "https://auth.example.com/environments/<environment_id>",
|
|
58
|
+
jwksUri:
|
|
59
|
+
"http://canopy.localhost:8080/environments/<environment_id>/.well-known/jwks.json",
|
|
60
|
+
},
|
|
61
|
+
```
|
|
62
|
+
|
|
53
63
|
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.
|
|
54
64
|
|
|
55
65
|
When the key comes from something injectable, use `forRootAsync`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canopy-io/nestjs",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
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.23.4"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|