@canopy-io/node 0.23.2 → 0.23.4

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,18 @@
1
1
  # @canopy-io/node
2
2
 
3
+ ## 0.23.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 7b022e1: Follows Canopy's November 12 release. The generated types add `require_sso_ready` to an organization's policy, which says whether `require_sso` can be turned on (an active SSO connection bound to the organization and a verified domain), and `conferred_capabilities` to administrator roles. Turning `require_sso` on before then, or removing an organization's last verified domain or disabling, unbinding or deleting its last active connection while it is on, answers `409`. An identity's session list now names a hosted sign-in no application has exchanged a code for yet by its session id, and `identities.revokeSession` ends it. No caller changes are needed.
8
+ - 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`.
9
+
10
+ ## 0.23.3
11
+
12
+ ### Patch Changes
13
+
14
+ - 9f196bc: Follows Canopy's November 12 release. The generated types add `POST /api/v1/scim-tokens/{id}/rotate`, which replaces a directory token and keeps the old one working for seven days, and carry the fields and error codes earlier releases added. The agent skill teaches that allowed web origins are each Environment's own list: a browser app's site listed only on another Environment is refused with `403 auth.origin_not_allowed` on the Direct API, and a public client's token request with `403 access_denied` (`@canopy-io/browser` raises `CanopyAuthError` with that code). It also says a backend calling Canopy for its browser sends no `Origin` of its own, forwarding one only with the Environment's secret API key, and gives the passkey calls' `{ data }` answers in full. No caller changes are needed.
15
+
3
16
  ## 0.23.2
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -200,6 +200,30 @@ the client calls it and `environmentId` resolves to an issuer under it, so the
200
200
  code stays what it is on hosted Canopy. An explicit `baseUrl` or `issuer` still
201
201
  wins.
202
202
 
203
+ That holds only while your backend reaches Canopy at the address its tokens
204
+ name. A backend that calls it by another name, such as a container using an
205
+ internal hostname, gets an issuer the tokens do not carry, and every token is
206
+ refused (`Token was issued by "…", not "…"`). Name the two separately: `issuer`
207
+ exactly as the token's `iss` reads, and `jwksUri` at the address your backend
208
+ can reach.
209
+
210
+ Canopy serves the signing keys only on its own hosts: the address its tokens
211
+ name, a loopback address, or a `*.localhost` name. Any other hostname, such as
212
+ a Docker service name, answers `404` with `auth.domain_host_not_served`, so
213
+ reach it by a `*.localhost` name (or a loopback address) instead.
214
+
215
+ ```ts
216
+ new TokenVerifier({
217
+ // What the token says: the address people sign in at.
218
+ issuer: "https://auth.example.com/environments/<environment_id>",
219
+ // Where this process fetches the signing keys from.
220
+ jwksUri:
221
+ "http://canopy.localhost:8080/environments/<environment_id>/.well-known/jwks.json",
222
+ });
223
+ ```
224
+
225
+ `CANOPY_BASE_URL` (or `baseUrl`) stays the address the client calls.
226
+
203
227
  With an Environment's **organizations** container on, an identity token also
204
228
  names the organization the session is acting in and the roles held at that
205
229
  organization's node, by name and by id. Read them through `orgContext` rather
package/dist/index.cjs CHANGED
@@ -686,7 +686,8 @@ var Identities = class {
686
686
  /**
687
687
  * Ends one session and leaves the identity's others signed in. `sessionId`
688
688
  * is the session's `id` from `sessions`: its current refresh token, which
689
- * changes on every refresh, so read it shortly before revoking.
689
+ * changes on every refresh, so read it shortly before revoking; or, for a
690
+ * hosted sign-in no application has exchanged a code for yet, its session id.
690
691
  */
691
692
  revokeSession(id, sessionId) {
692
693
  return this.client.request(