Improve ACP auth and origin defaults (#9886)
This commit is contained in:
@@ -204,12 +204,12 @@ For servers that support the draft standard ACP over Streamable HTTP https://git
|
||||
npm start -- --server http://HOST:PORT
|
||||
|
||||
# example server
|
||||
cargo run -p goose-cli --bin goose -- serve
|
||||
GOOSE_SERVER__SECRET_KEY='a-long-random-secret' cargo run -p goose-cli --bin goose -- serve
|
||||
```
|
||||
|
||||
### Server Authentication
|
||||
|
||||
Set the `GOOSE_SERVER__SECRET_KEY` environment variable to require authentication on the ACP endpoint. When it is set, `goose serve` rejects any request that doesn't present a matching token:
|
||||
Set the `GOOSE_SERVER__SECRET_KEY` environment variable to authenticate the ACP endpoint. `goose serve` refuses to start without this secret unless you explicitly pass `--dangerously-unauthenticated`:
|
||||
|
||||
```bash
|
||||
GOOSE_SERVER__SECRET_KEY='a-long-random-secret' goose serve
|
||||
@@ -217,7 +217,16 @@ GOOSE_SERVER__SECRET_KEY='a-long-random-secret' goose serve
|
||||
|
||||
Clients authenticate by sending the token in the `X-Secret-Key` header, or as a `?token=` query parameter for WebSocket connections (the browser WebSocket API can't set custom headers). Requests without a matching token receive `401 Unauthorized`, including WebSocket handshakes.
|
||||
|
||||
When `GOOSE_SERVER__SECRET_KEY` is not set, the endpoint accepts unauthenticated connections and `goose serve` logs a warning at startup.
|
||||
ACP WebSocket Origin validation allows loopback web origins by default. For `goose serve`, ACP CORS follows the same policy. If you pass any `--allowed-origin` values, that explicit list replaces the default loopback origins, so include every origin the client needs:
|
||||
|
||||
```bash
|
||||
GOOSE_SERVER__SECRET_KEY='a-long-random-secret' goose serve \
|
||||
--allowed-origin 'http://localhost:5173' \
|
||||
--allowed-origin 'app://localhost' \
|
||||
--allowed-origin 'https://app.example'
|
||||
```
|
||||
|
||||
For local development only, `goose serve --dangerously-unauthenticated` starts without a secret and logs a warning. Do not use this mode with shell-capable builtins enabled unless the server is isolated from untrusted browser traffic.
|
||||
|
||||
### Single Prompt Mode
|
||||
|
||||
|
||||
@@ -514,7 +514,7 @@ These variables configure the `goosed` server process. They are most often used
|
||||
| `GOOSE_HOST` | Interface the server binds to. Use `0.0.0.0` to accept connections from other machines; `localhost` or `127.0.0.1` restricts to the local machine. | Hostname or IP | `127.0.0.1` |
|
||||
| `GOOSE_PORT` | TCP port the server listens on | Port number | `3000` |
|
||||
| `GOOSE_TLS` | Enable TLS with a self-signed certificate. Required when connecting goose Desktop to a remote `goosed`. | `true`, `false` | `true` |
|
||||
| `GOOSE_SERVER__SECRET_KEY` | Shared secret required in the `X-Secret-Key` header on all client requests. When set, it is also enforced on the `goose serve` ACP endpoint. | Secret string | Random (auto-generated) |
|
||||
| `GOOSE_SERVER__SECRET_KEY` | Shared secret required in the `X-Secret-Key` header on all client requests. `goosed` auto-generates one when unset; `goose serve` requires this variable unless started with `--dangerously-unauthenticated`. | Secret string | Random for `goosed`; required for `goose serve` |
|
||||
|
||||
**Examples**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user