@procedures/client 0.27.3 → 0.27.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 +29 -0
- package/README.md +1 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapters/http/server/handler.js +3 -2
- package/dist/adapters/http/server/handler.js.map +1 -1
- package/dist/adapters/websocket/server/transport.d.ts.map +1 -1
- package/dist/adapters/websocket/server/transport.js +3 -2
- package/dist/adapters/websocket/server/transport.js.map +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/procedure-server.d.ts +6 -6
- package/dist/server/request-auth.d.ts +5 -1
- package/dist/server/request-auth.d.ts.map +1 -1
- package/dist/server/request-auth.js +26 -0
- package/dist/server/request-auth.js.map +1 -1
- package/dist/server/types.d.ts +40 -3
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/http/server/handler.ts +3 -2
- package/src/adapters/websocket/server/transport.ts +3 -2
- package/src/browser.ts +1 -0
- package/src/server/index.ts +1 -0
- package/src/server/procedure-server.ts +6 -6
- package/src/server/request-auth.ts +26 -2
- package/src/server/types.ts +41 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @procedures/client
|
|
2
2
|
|
|
3
|
+
## 0.27.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8970a1e: The credentials of a network request have the connection of its socket (CLI-71). Thus the request hook (`principalOf`), `authenticate` and `ProcedureServer.admission()` can find the caller from its TCP peer. The fleet site finds the Claude session of a caller with it and `resources.peer` of headroom.
|
|
8
|
+
|
|
9
|
+
PATCH: a new optional field and a new optional input. Before 1.0, a feature that is compatible with the old API is a PATCH. A hook that does not read the field sees no change.
|
|
10
|
+
|
|
11
|
+
Added:
|
|
12
|
+
|
|
13
|
+
- `Credentials.connection`, of the new type `RequestConnection`: the `remoteAddress`, the `remotePort`, the `localAddress` and the `localPort` of the socket, as frozen plain data.
|
|
14
|
+
- Each field of `RequestConnection` is optional. A Unix socket and a named pipe have no ports, and a socket that closed has no addresses.
|
|
15
|
+
- The optional `socket` of the request of `requestCredentials()`. With it, the credentials have the connection. Without it, the credentials stay as before.
|
|
16
|
+
|
|
17
|
+
Changed:
|
|
18
|
+
|
|
19
|
+
- The HTTP face (`procedureHandler`, `HttpServerTransport`) sets the connection on the credentials of each request.
|
|
20
|
+
- The WebSocket face sets it on the credentials of the upgrade (`admits()`) and of each call over that connection.
|
|
21
|
+
- The MCP HTTP face sets it on the credentials of the one admission of each HTTP request. The admitted credentials keep it. A tool call uses them, and the server does not do the checks again for it (CLI-2b).
|
|
22
|
+
- With a handler without `admission()`, the MCP HTTP face gives each tool call the credentials of its HTTP request, with the connection. Before, the face read the same headers and query again from the request information of the SDK, without the connection.
|
|
23
|
+
- A local request has no connection: a call in this process, MCP over stdio or a message port.
|
|
24
|
+
- An SDK transport of the application (`sdkTransport` of `McpServerTransport`, for example the legacy SSE transport of the MCP SDK) gives no connection. The SDK gives only the headers and the URL of each request, not its socket.
|
|
25
|
+
|
|
26
|
+
Notes:
|
|
27
|
+
|
|
28
|
+
- The connection comes only from the socket. It does not come from `X-Forwarded-For` or `Forwarded`. Behind a proxy, the peer is the proxy. Thus a request hook that trusts the connection there sees the proxy.
|
|
29
|
+
- The key of the idempotency cache has the principal (audit s21). When the principal comes from the connection, two callers behind one address can have one principal. Then a call of one caller can get the cached result of a call of the other caller with the same idempotency key.
|
|
30
|
+
- The admitted credentials and their identity (CLI-2b) do not change. A copy of the admitted credentials still goes through the checks.
|
|
31
|
+
|
|
3
32
|
## 0.27.3
|
|
4
33
|
|
|
5
34
|
No changes in this release.
|
package/README.md
CHANGED
|
@@ -753,6 +753,7 @@ const server = new ProcedureServer({
|
|
|
753
753
|
- `narrowing`: a narrower capability that the request asks for. The server narrows the capability of the call with it. A request for more has no effect.
|
|
754
754
|
- An empty object accepts the request without a principal. Undefined, or an error, refuses the request with `UNAUTHORIZED`.
|
|
755
755
|
- `authenticate` operates after the hook and can read `request.principal`. A local request does not go through the hook.
|
|
756
|
+
- `credentials.connection` has the addresses and the ports of the socket of a network request (CLI-71). Only the socket gives them, not `X-Forwarded-For`. Behind a proxy, they are the addresses of the proxy. A local request has no connection.
|
|
756
757
|
- `hostPolicy({ principalOf })` gives the hook to each server of the policy.
|
|
757
758
|
|
|
758
759
|
#### Local requests
|