# Proxy Permissions Reference **Page:** foundation/proxy/permissions/reference [Download Raw Markdown](./foundation/proxy/permissions/reference.md) --- # Proxy Permissions Reference Look up fields, limits and errors here; the [Proxy Permissions guide](/foundation/proxy/permissions/) covers the tasks, and the [API reference](/api/proxy-permissions/) lists every endpoint. ## Permissions document ```text { "project": "string (required, project ID)", "computer": "string (required for computer-level; omit at project level)", "groups": { "{groupName}": { "type": "jwt" | "password" | "ip" | "token" | "hoody-identity", // ... type-specific fields } }, "permissions": { "{groupName}": { // Network programs (terminal, display, http): boolean, a port/instance // number, an array of numbers, a port-range string like "8000-8100", or "*" "terminal": true | false | number | [number] | "8000-8100" | "*", "display": true | false | number | [number] | "8000-8100" | "*", // http and https must NAME their ports: no true, false, or "*", // and at most 16384 ports per cell "http": [8080] | 8080 | "8000-8100", // Boolean-only programs (files, exec, services, notifications, logs) "files": true | false, "exec": true | false, "services": true | false, "notifications": true | false, "logs": true | false } }, "default": "allow" | "deny" | "inherit", // inherit: computer only, follows the project's "enable_proxy": true | false // optional; project: on when omitted; computer: follows the project when omitted from a replacement. To clear with null, use the state or settings endpoint } ``` | Rule | Detail | |---|---| | `default` | The fallback when no applicable permission cell decides the request and no password challenge or other refusal applies. This includes a caller whose matching groups have absent or `null` cells for the requested program. On a computer, `"inherit"` uses the project's, or `allow` when the project has no document; a project refuses it. A full replacement through the API without `default` stores `"deny"` | | Read-only fields | `schema_version`, `file_version` and `etag` are server-owned. A full replacement ignores supplied values, so the document in the GET response's `data` can be sent back with those fields unchanged | | GET response | Envelope: `{ statusCode, message, data }` | | Size | 256 groups and 1 MiB per document. A document over either can be edited and reduced, not grown | | One group, one type | An array of definitions is rejected | | `hooks` | Refused with `422` on a project document: hooks are computer-level | | Writes | Need `If-Match: file:v` from a prior GET, and bump `file_version`. Absent returns `428`, stale returns `412` | The computer's proxy configuration has three sibling resources: [hooks](/foundation/proxy/hooks/) (MITM scripts inside your own `hoody-exec`), [settings](/foundation/proxy/settings/) (root `enable_proxy` and `default`, with ETag concurrency) and [aliases](/foundation/proxy/aliases/) (custom subdomains). Hooks are stored in this document and readable through it. A bulk replacement can carry them: each service maps to an array of rules, and each rule's `id` is a 26-character lowercase ULID, unique across the document, so keep the ids GET returned. `POST /proxy/hooks/` assigns ids to new hooks. Granular permission writes leave hooks untouched. ## Group fields ### `jwt` | Field | Required | Rule | |---|---|---| | `secret` | Yes | Up to 8192 characters. `RS256`/`ES256`: the PEM-encoded SPKI public key | | `algorithm` | Yes | `HS256`, `RS256` or `ES256` | | `sources` | Yes | `header:Name` or `cookie:Name` only, such as `cookie:__Host-session`. Header values must be `Bearer `, custom headers included; cookie values carry the bare JWT. An absent or empty list is refused | | `claims` | No | Required JWT claims | | `header_authoritative` | No | `true`: when a configured header source is present, even empty, only header sources decide. `false` or omitted: a valid token in any configured source counts | Reading a header or a cookie, and requiring two claims: ```json { "type": "jwt", "secret": "a-long-random-signing-key-with-32-plus-chars", "algorithm": "HS256", "sources": ["header:Authorization", "cookie:__Host-auth_token"], "claims": { "iss": "mycompany.com", "aud": "production-api" } } ``` Use `HS256` when you sign your own tokens. Use `RS256` or `ES256` when another system signs them, such as your login provider: `secret` then holds its public key, so the document holds nothing that can sign a token. - An `HS256` secret is checked on write: at least 32 characters, no PEM key material, and no common word such as `secret`, `password`, `123456`, `test`, `dev` or `default` anywhere in it. - A secret already stored under the same algorithm skips the check; anything new or changed is validated. - An invalid token in one source does not hide a valid one in another, and repeated copies of a header or cookie are considered, up to the limits below. - The login `identity_claim` is a detached-signature ED25519 bundle, not a JWT, so this group cannot verify it: see [Identity claims](/api/authentication/#identity-claims). ### `password` | Field | Required | Rule | |---|---|---| | `username` | Yes | Exact match | | `password` | Yes | Plain, which the API hashes with the salt, or a lowercase hex digest of `SHA256(salt + password)`. A 64-character hex value is taken as a digest; anything else is hashed | | `algorithm` | In a full document | `algorithm: "sha256"`, the only option (no bcrypt or argon2). For stronger auth, use JWT. The password-group endpoint defaults to it | | `salt` | Yes | The salt used for the digest | ```bash # Salt text directly followed by the password, UTF-8, nothing in between printf %s "${SALT}${PASSWORD}" | sha256sum ``` Any HTTP client can send it, which suits emergency access and internal tools. Credentials can go in a URL (`https://user:pass@domain.com` works in most contexts). There is no expiry or refresh to manage, and it works when an external OAuth provider is down. ### `ip` | Field | Required | Rule | |---|---|---| | `range` | Yes | IPv4 CIDR, `203.0.113.50/32` for one IP. Matches the actual client IP | Dynamic IPs need JWT or token groups, or a VPN with static exit IPs. Other layers: [allow only certain client IPs](/foundation/networking/firewall/#allow-only-certain-client-ips). ### `token` | Field | Required | Rule | |---|---|---| | `value` | Yes | One value, stored and compared as given. `algorithm` and `salt` are not accepted, so it cannot be stored hashed | | `header`, `cookie` or `param` | Exactly one | Where it is read from | ### `hoody-identity` Matches "a valid Hoody user". A group alone is not a gate: the document must also set explicit program cells and `"default": "deny"`, as this example does. Set it through a full-document write; it has no dedicated group endpoint. The example below is a fragment: add `project` with your project ID, and for a computer-level write also add `computer` with your computer ID. Other fields (`allow_types`, `users`, `max_age_seconds`): [API reference](/api/proxy-permissions/#hoody-identity-group-fields). ```json { "groups": { "hoody_users": { "type": "hoody-identity", "audience": "myapp.example.com" } }, "permissions": { "hoody_users": { "run": true } }, "default": "deny" } ``` | Item | Rule | |---|---| | `audience` | Required: 1 to 256 printable ASCII characters, no whitespace or double quotes. The claim's `aud` must equal it exactly. Mint with `POST /api/v1/users/auth/identity-claim { "audience": "myapp.example.com" }`. Unbound login-issued claims, such as the generic 30-day one, are always rejected | | `sources` | Headers in the reserved namespace; default `["header:X-Hoody-Identity-Claim"]`. Clients send `..` | | `expose_type` | Off by default. Also injects `X-Hoody-Identity-Type`. Not a role: do not authorize on it | | Your app receives | Client-supplied `X-Hoody-Identity-*` headers are stripped on every reverse-proxy request. Your app receives verified `X-Hoody-Identity-Sub` (user ID) and `X-Hoody-Identity-Username` only when the identity group contributes an allowing program grant. Requests admitted only by another group or by `default`, and CDP requests, carry no verified identity headers. Never the claim | | Keys | Hoody manages them; group config never carries any | | After activating | A curl without the header must get `403`. Once a gate has been active, an unavailable policy denies, never opens | | Clients | Programmatic only. Browsers cannot attach headers on navigation: use a [proxy hook](/foundation/proxy/hooks/#identity-claim-auth-gate) | | Coverage | Reverse proxy only, not forward-proxy or CONNECT products | | WebSockets | Handshakes are gated; established sockets outlive claim expiry, so end them server-side for a live cutoff | ## Credential limits | Limit | Value | |---|---| | Candidates per token or JWT definition, per request | 16 signed (`RS256`/`ES256`) or 256 other, shared across its sources | | Candidates per request | 128 signed and 4096 other | | Definitions to stay within, per computer | 8 signed and 16 other | | Login work per request | About 4 MiB, shared by computer and project groups. Each definition visited, value read and stored secret, salt or password read uses some, as do planted copies of a plain-named cookie | | Login work examples | 256 password groups with an ordinary Authorization header: about a third at worst. The header's length is charged for every password group, so a header of about 60 KB uses up the allowance after 69 groups. Token of about 7.8 KB: fits at 256 JWT groups reading one header. About 3.7 KB: at 256 on the computer plus 256 on the project | | `RS256` RSA keys | 2048 to 8192 bits, public exponent at most 65537 | ### Cookie credentials A cookie credential is a browser login cookie your app sets, read through a `jwt` `cookie:` source or a `cookie` token. Use one when people sign in from a browser. | Rule | Detail | |---|---| | Use `__Host-` (`Secure; Path=/`), no `Domain`, set from the address it protects | Only that cookie is known to come from that address, and other addresses cannot add same-named copies. Applies to `cookie` tokens too | | Keep the name for credentials | On reverse-proxy requests, every cookie whose name is a token group's cookie source is removed before forwarding, whatever its value or copy count. A JWT cookie source does not itself cause stripping: your app must validate forwarded JWT cookies and handle duplicate names safely | | Narrowing | A cookie a program sets in an HTTP response for a parent of its Hoody address is narrowed to that address. Page-script cookies and cookies a browser already holds keep their scope | | One login, several addresses | Your own custom domain with `Domain=`, or one address with path routing, or a sign-in per address, for example a password group, or your app's own sign-in that sets its own `__Host-` cookie | | Link parameters | Never set a login cookie from one: anyone can send such a link | Moving a parent-domain login cookie, before narrowing reaches your address: stop setting it for the parent (server responses and page scripts), move the group to a `__Host-` name or invalidate the old token, then check the old cookie is refused. Otherwise an old copy works after logout until it expires. ## Access values | Value | Allows | Not accepted by | |---|---|---| | `true`, `false` | All instances, or none | `http`, `https` | | Number | That instance or port | Boolean-only programs | | Array | Those instances or ports | Boolean-only programs | | `"start-end"` | Inclusive range, such as `"1-3"` | Boolean-only programs | | `"*"` | Every instance | `http`, `https`, boolean-only programs | ### Programs The API accepts 28 names in a cell: 24 program names, three protocols (`http`, `https`, `ssh`) and `services`. The catch-all `*` is extra, and anything else is rejected. **Use the program name in a cell, not an alias.** Aliases work in hostnames and as proxy-alias targets; permission cells require canonical program names. A cell named with one gets `422` naming the program: `Program "t" is an alias of "terminal"; permission keys must use the canonical name "terminal" (the proxy looks permissions up by canonical program name only)`. A cell stored earlier under an alias grants and refuses nothing, so `"t": false` beside `"*": true` leaves the terminal open. Delete it and write the program name; a full write that carries it unchanged is accepted. **The catch-all `*`.** As a program name, `*` covers every program a group has no cell for: `"permissions": {"ops": {"*": true}}`. It takes a boolean. The value `"*"` is different: it means every instance of one program, as in `"terminal": "*"`. | With `"*": true` | Result | |---|---| | Named programs | A specific cell beats it, so `"terminal": false` beside it still refuses the terminal | | Raw ports | With no `http` or `https` cell, the route falls back to `*`, so every raw port opens, including unnamed listeners such as display ports. The refusal in [Port grants](#port-grants) does not apply. A present `http` or `https` cell outranks `*` on raw ports | | Port 45, the Hoody Agent API | Also passes through the group's own `agent` cells, which can refuse it, and `*` is not read there | | `logs` | Never granted by `*` | | Program | Hostname aliases | Gates | |---|---|---| | `terminal` | `t`, `tty`, `ttyd` | Hoody Terminal | | `display` | `d` | Hoody Displays: browser viewer and HTTP API (screenshots, mouse, keyboard, window, clipboard). No view-only level; the viewer's `?readonly=true` blocks its own input | | `desktop` | | Terminal kit in desktop mode | | `d-tcp` | `dt` | The direct display WebSocket endpoint | | `files` | `f` | Hoody Files. Boolean only | | `exec` | `e` | Hoody Exec. Boolean only | | `browser` | `b` | Remote browsers | | `cdp` | | A browser's Chrome DevTools Protocol endpoint. Requires effective access to the matching `browser` instance. When no applicable `cdp` or `*` cell restricts the request, CDP adds no further restriction, even under `default: deny`. Set an explicit `cdp` restriction when browser users must not get CDP access | | `code` | | Hoody Code | | `agent` | | Hoody Agent | | `sqlite` | | SQLite database service | | `notes` | `note` | Collaborative notes and documents | | `notifications` | `notification`, `n` | Notification server. Boolean only | | `watch` | `w` | File-change watch and event replay | | `cron` | | Crontab management | | `curl` | | cURL HTTP client service | | `run` | | Hoody Run command resolver | | `pipe` | | Hoody Pipe streaming | | `tunnel` | | Reverse-tunnel gateway | | `egress` | | Outbound egress proxy | | `workspaces` | `workspace`, `os` | Hoody Workspaces | | `vm` | | QEMU virtual machines inside the computer | | `daemon` | | Computer daemon and its background programs | | `logs` | `log`, `l` | Proxy-side request and response logs, which include visitor traffic, subject to logging exclusions; requests to the logs service itself are excluded by default. Boolean only. A `*` cell never grants it. Under `deny`, a group needs its own `"logs": true`. Under `allow` or with no rules, callers who match no group can read logs. Retained history of a deleted computer is denied when no policy remains; a remaining project policy can still allow it. Under `allow`, a `*` cell can still refuse them | | `services` | | Accepted as a boolean by the API, but does not gate a routed program. Set each program's own permission cell | | `http`, `https` | | Transport labels gating raw ports | | `ssh` | | Transport label, accepted but inert: `ssh` hostnames carry no port and route to the SSH proxy. Use SSH key configuration | ### Port grants | Rule | Detail | |---|---| | Hostname form | `{projectId}-{computerId}-http-8080.{server}.computers.hoody.com` | | Why ports are named | An `http` or `https` cell cannot grant all ports, which would hand out every raw computer port. A catch-all `"*": true` can: see [Programs](#programs) | | Cap | 16,384 per cell, not per computer. A list of 16,385 or a wider range gets `422`. `"3000-9000"` fits, and spans the display instance ports (4000 plus the instance number) | | Reserved | In an `http` or `https` cell, Hoody Kit's fixed service ports and the base ports of its display and browser instance ranges are refused, even inside a wide range | | Instance ports | Not reserved. Browser instance ports (30000 plus the instance number) and display instance ports inside a granted range are reachable, even with `"browser": false` or `"display": false` | | Code editor instance ports | Use the matching `code` instance permission, not an `http` or `https` grant | | Everything else | Other application-port grants expose whichever program listens there, without inspection | ## Project and computer documents | Situation | Result | |---|---| | Both exist | Merged; computer values win overlaps | | One exists | It applies | | Neither | Open to anyone with the URL | | Computer sets `default` | `"allow"` or `"deny"` takes precedence over the project's. `"inherit"` uses the project's, or `allow` when the project has no document | | Computer has no document | GET reads as no groups and `"default": "inherit"`; the project's rules apply | | First single-field write on a computer with no document (group, cell, hook or `enable_proxy`) | Stores `"default": "inherit"` with the change, so the project's `default` still applies | | Computer grants a group defined only in the project | Allowed without copying it | | Same group name in both | The computer's definition replaces the project's whole, but permission cells merge one by one. A computer that redefines `team` still gives it the project's `terminal` cell unless it sets that cell. Pick a new name unless you mean this | | Project later removes that group | The cell grants nothing; other groups and `default` decide. The cell can be deleted; the computer stays editable | | New reference to a group in neither document | Rejected | | Computer document deleted | Project policy applies if any, otherwise open | | IP and JWT both required at once | Not supported; use a proxy hook | | A request newly matches a group | If no matched group allows the program, an explicit non-allowing rule gives `403`. A newly matched allowing group can change which hooks apply | ## `enable_proxy` | Case | Behaviour | |---|---| | Project unset or omitted | On | | Computer unset | Follows the project. A replacement that omits it leaves it unset, and GET omits it | | Explicit computer value | Overrides the project in both directions | | `false` | A kill-switch, not a bypass: the proxy answers `403` itself | | Flip | Can take several seconds or longer; applies to new connections | | Change it alone | `PATCH .../proxy/permissions/state`; computers also `PUT .../proxy/settings` | | Turning a project off | Set `false` on each computer with an explicit `true`, or clear it to follow the project | | Clearing a computer's value | Send `"enable_proxy": null` to `PATCH .../proxy/permissions/state` or `PUT .../proxy/settings` (CLI: `hoody computers proxy settings update --unset-enable-proxy`). A full replacement that omits it, or deleting the computer's document, also clears it. A project refuses `null` | | Cut-off on a computer with no document | Creates a document with `"enable_proxy": false` and `"default": "inherit"`. Turning it back on stores an explicit `true`; send `null` instead to follow the project | ## Change publication A successful write saves the change; publication can stay pending or fail. `propagation.state: "applied"` means publication completed, not that the proxy enforces it. A saved change can take several seconds or longer to affect requests, with no guaranteed maximum, so do not assume a revoked credential stops working at once. ## Common setups Replace a whole document replaces the document in every tab, so groups you already have are gone. In the next three recipes and Partner tiers by token, the SDK, HTTP and URL tabs replace it too, while the CLI tab adds to it, so groups you already have survive, except one with the same name as a recipe's group, which is replaced. Temporary support session adds in every tab, and its cleanup deletes the computer's whole document: use that cleanup only on a computer that had no document before, otherwise delete the group and set `default` back. Where a tab adds, list your groups first and delete any you no longer want. The CLI tabs set `default` to `deny` first on the document they write, so a computer recipe holds whatever the project's `default` is. Every write changes the document's `etag`. Where a tab runs several writes in a row, read the document again before each one and replace `file:v` with its current `etag`; reusing the previous value fails with `412`. The secrets and passwords in these recipes are placeholders: replace each with a unique value before running. Replace the example IP ranges (`203.0.113.0/24`, `198.51.100.0/24`) with the public IPv4 ranges of the people you grant access. ### Replace a whole document Use this to change many rules in one write, or to clear out groups you no longer want. Anything you leave out is gone, including the computer's `hooks` and an explicit `enable_proxy`; copy both from a GET into the request to keep them. Every tab sends the same two files. `groups.json` holds the `groups` map: ```json { "team": { "type": "ip", "range": "203.0.113.0/24" } } ``` `permissions.json` holds the `permissions` map: ```json { "team": { "terminal": [1, 2], "files": true } } ``` ```bash hoody projects proxy permissions get --project $PROJECT_ID hoody projects proxy permissions set --project $PROJECT_ID \ --groups @groups.json --permissions @permissions.json --default deny --if-match 'file:v' # For one computer: hoody computers proxy permissions set -c $COMPUTER_ID --project $PROJECT_ID ... ``` ```typescript import { readFileSync } from 'node:fs'; await client.api.projects.proxy.setPermissions(PROJECT_ID, { project: PROJECT_ID, groups: JSON.parse(readFileSync('groups.json', 'utf8')), permissions: JSON.parse(readFileSync('permissions.json', 'utf8')), default: 'deny' }, { ifMatch: 'file:v' }); ``` ```bash curl "https://api.hoody.com/api/v1/projects/$PROJECT_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" curl -X PUT "https://api.hoody.com/api/v1/projects/$PROJECT_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d "$(jq -n --arg project "$PROJECT_ID" \ --slurpfile groups groups.json --slurpfile permissions permissions.json \ '{project: $project, groups: $groups[0], permissions: $permissions[0], default: "deny"}')" ``` ### API with JWT customers and a private admin Customers with a valid JWT reach port 8080; `admin` uses a password. Everyone else is refused: `401` on the programs `admin` is granted, `403` elsewhere. Groups from the project still apply. ```bash hoody computers proxy default set -c $COMPUTER_ID --default deny --if-match 'file:v' hoody computers proxy groups jwt set customers -c $COMPUTER_ID \ --secret 'a-long-random-signing-key-with-32-plus-chars' \ --algorithm HS256 --sources header:Authorization --if-match 'file:v' hoody computers proxy groups password set admin -c $COMPUTER_ID \ --auth-username admin --auth-password 'a-long-admin-password' \ --salt 'unique-salt' --if-match 'file:v' hoody computers proxy groups permissions set customers http -c $COMPUTER_ID \ --access '[8080]' --if-match 'file:v' hoody computers proxy groups permissions set admin terminal -c $COMPUTER_ID \ --access true --if-match 'file:v' hoody computers proxy groups permissions set admin display -c $COMPUTER_ID \ --access true --if-match 'file:v' hoody computers proxy groups permissions set admin files -c $COMPUTER_ID \ --access true --if-match 'file:v' hoody computers proxy groups permissions set admin http -c $COMPUTER_ID \ --access '[8080]' --if-match 'file:v' ``` ```typescript await client.api.computers.proxy.setPermissions(COMPUTER_ID, { project: PROJECT_ID, computer: COMPUTER_ID, groups: { customers: {type: 'jwt', secret: 'a-long-random-signing-key-with-32-plus-chars', algorithm: 'HS256', sources: ['header:Authorization']}, admin: {type: 'password', username: 'admin', password: 'a-long-admin-password', algorithm: 'sha256', salt: 'unique-salt'}, }, permissions: { customers: {http: [8080]}, admin: {terminal: true, display: true, files: true, http: [8080]}, }, default: 'deny' }, { ifMatch: 'file:v' }); ``` ```bash curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{ "project": "'$PROJECT_ID'", "computer": "'$COMPUTER_ID'", "groups": { "customers": {"type": "jwt", "secret": "a-long-random-signing-key-with-32-plus-chars", "algorithm": "HS256", "sources": ["header:Authorization"]}, "admin": {"type": "password", "username": "admin", "password": "a-long-admin-password", "algorithm": "sha256", "salt": "unique-salt"} }, "permissions": { "customers": {"http": [8080]}, "admin": {"terminal": true, "display": true, "files": true, "http": [8080]} }, "default": "deny" }' ``` ' }} json={{project: 'PROJECT_ID', computer: 'COMPUTER_ID', groups: {customers: {type: 'jwt', secret: 'a-long-random-signing-key-with-32-plus-chars', algorithm: 'HS256', sources: ['header:Authorization']}, admin: {type: 'password', username: 'admin', password: 'a-long-admin-password', algorithm: 'sha256', salt: 'unique-salt'}}, permissions: {customers: {http: [8080]}, admin: {terminal: true, display: true, files: true, http: [8080]}}, default: 'deny'}} bearerToken="HOODY_TOKEN" > Run this link through a separate computer in a different project whose cURL URL stays reachable. Writes both groups and grants in one request. The If-Match value must be the document's current `etag` (`file:v`). ### Three access tiers Ops gets terminal, display, files and port 8080; developers lose display; the third tier gets port 8080 only. A port grant allows every HTTP method: enforce read-only behaviour in your application. ```bash hoody projects proxy default set --project $PROJECT_ID --default deny --if-match 'file:v' hoody projects proxy groups ip set ops_team --project $PROJECT_ID \ --range 203.0.113.0/24 --if-match 'file:v' hoody projects proxy groups ip set developers --project $PROJECT_ID \ --range 198.51.100.0/24 --if-match 'file:v' hoody projects proxy groups password set port_users --project $PROJECT_ID \ --auth-username viewer --auth-password 'a-long-viewer-password' \ --salt 'salt' --if-match 'file:v' hoody projects proxy groups permissions set ops_team terminal --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set ops_team display --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set ops_team files --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set ops_team http --project $PROJECT_ID \ --access '[8080]' --if-match 'file:v' hoody projects proxy groups permissions set developers terminal --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set developers files --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set developers http --project $PROJECT_ID \ --access '[8080]' --if-match 'file:v' hoody projects proxy groups permissions set port_users http --project $PROJECT_ID \ --access '[8080]' --if-match 'file:v' hoody projects proxy groups permissions set port_users terminal --project $PROJECT_ID \ --access false --if-match 'file:v' hoody projects proxy groups permissions set port_users display --project $PROJECT_ID \ --access false --if-match 'file:v' hoody projects proxy groups permissions set port_users files --project $PROJECT_ID \ --access false --if-match 'file:v' ``` ```typescript await client.api.projects.proxy.setPermissions(PROJECT_ID, { project: PROJECT_ID, groups: { ops_team: {type: 'ip', range: '203.0.113.0/24'}, developers: {type: 'ip', range: '198.51.100.0/24'}, port_users: {type: 'password', username: 'viewer', password: 'a-long-viewer-password', algorithm: 'sha256', salt: 'salt'}, }, permissions: { ops_team: {terminal: true, display: true, files: true, http: [8080]}, developers: {terminal: true, files: true, http: [8080]}, port_users: {http: [8080], terminal: false, display: false, files: false}, }, default: 'deny' }, { ifMatch: 'file:v' }); ``` ```bash curl -X PUT "https://api.hoody.com/api/v1/projects/$PROJECT_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{ "project": "'$PROJECT_ID'", "groups": { "ops_team": {"type": "ip", "range": "203.0.113.0/24"}, "developers": {"type": "ip", "range": "198.51.100.0/24"}, "port_users": {"type": "password", "username": "viewer", "password": "a-long-viewer-password", "algorithm": "sha256", "salt": "salt"} }, "permissions": { "ops_team": {"terminal": true, "display": true, "files": true, "http": [8080]}, "developers": {"terminal": true, "files": true, "http": [8080]}, "port_users": {"http": [8080], "terminal": false, "display": false, "files": false} }, "default": "deny" }' ``` ' }} json={{project: 'PROJECT_ID', groups: {ops_team: {type: 'ip', range: '203.0.113.0/24'}, developers: {type: 'ip', range: '198.51.100.0/24'}, port_users: {type: 'password', username: 'viewer', password: 'a-long-viewer-password', algorithm: 'sha256', salt: 'salt'}}, permissions: {ops_team: {terminal: true, display: true, files: true, http: [8080]}, developers: {terminal: true, files: true, http: [8080]}, port_users: {http: [8080], terminal: false, display: false, files: false}}, default: 'deny'}} bearerToken="HOODY_TOKEN" > Run this link through a separate computer in a different project whose cURL URL stays reachable. Writes all three tiers in one request. The If-Match value must be the document's current `etag` (`file:v`). ### Staging on the project, JWT customers on production On production, the project's `team` group still grants its access alongside `customers`. ```bash # Staging: the project hoody projects proxy default set --project $PROJECT_ID --default deny --if-match 'file:v' hoody projects proxy groups ip set team --project $PROJECT_ID \ --range 203.0.113.0/24 --if-match 'file:v' hoody projects proxy groups permissions set team terminal --project $PROJECT_ID \ --access true --if-match 'file:v' hoody projects proxy groups permissions set team http --project $PROJECT_ID \ --access '[8080]' --if-match 'file:v' hoody projects proxy groups permissions set team display --project $PROJECT_ID \ --access true --if-match 'file:v' # Production: one computer hoody computers proxy default set -c $COMPUTER_ID --default deny --if-match 'file:v' hoody computers proxy groups jwt set customers -c $COMPUTER_ID \ --secret 'a-long-random-signing-key-with-32-plus-chars' \ --algorithm HS256 --sources header:Authorization --if-match 'file:v' hoody computers proxy groups permissions set customers http -c $COMPUTER_ID \ --access '[8080]' --if-match 'file:v' ``` ```typescript // Staging: the project await client.api.projects.proxy.setPermissions(PROJECT_ID, { project: PROJECT_ID, groups: { team: {type: 'ip', range: '203.0.113.0/24'}, }, permissions: { team: {terminal: true, http: [8080], display: true}, }, default: 'deny' }, { ifMatch: 'file:v' }); // Production: one computer await client.api.computers.proxy.setPermissions(COMPUTER_ID, { project: PROJECT_ID, computer: COMPUTER_ID, groups: { customers: {type: 'jwt', secret: 'a-long-random-signing-key-with-32-plus-chars', algorithm: 'HS256', sources: ['header:Authorization']}, }, permissions: { customers: {http: [8080]}, }, default: 'deny' }, { ifMatch: 'file:v' }); ``` ```bash # Staging: the project curl -X PUT "https://api.hoody.com/api/v1/projects/$PROJECT_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{ "project": "'$PROJECT_ID'", "groups": { "team": {"type": "ip", "range": "203.0.113.0/24"} }, "permissions": { "team": {"terminal": true, "http": [8080], "display": true} }, "default": "deny" }' # Production: one computer curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{ "project": "'$PROJECT_ID'", "computer": "'$COMPUTER_ID'", "groups": { "customers": {"type": "jwt", "secret": "a-long-random-signing-key-with-32-plus-chars", "algorithm": "HS256", "sources": ["header:Authorization"]} }, "permissions": { "customers": {"http": [8080]} }, "default": "deny" }' ``` ' }, json: {project: 'PROJECT_ID', groups: {team: {type: 'ip', range: '203.0.113.0/24'}}, permissions: {team: {terminal: true, http: [8080], display: true}}, default: 'deny'} }, { label: 'Production: one computer', method: 'PUT', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' }, json: {project: 'PROJECT_ID', computer: 'COMPUTER_ID', groups: {customers: {type: 'jwt', secret: 'a-long-random-signing-key-with-32-plus-chars', algorithm: 'HS256', sources: ['header:Authorization']}}, permissions: {customers: {http: [8080]}}, default: 'deny'} }, ]} > Run these links through a separate computer in a different project whose cURL URL stays reachable throughout setup and cleanup. The If-Match value must be the document's current `etag` (`file:v`). ### Temporary support session This grants `support` terminal 1, display 1 with full mouse, keyboard and clipboard control, and files. It sets the computer's `default` to `deny`, but existing computer and project grants can still apply. Read both documents before relying on this as exclusive access. Note the current `default` before you start. If a group named `support` already exists on the computer or in the project's document, use another name throughout. On the computer, setting it replaces that group's login, and the cleanup deletes it with its grants. In the project, its permission cells merge into the temporary login, so a project `support` cell such as `exec` would apply to it too. Afterwards, delete the group. Setting a cell to `false` instead is a different result: `false` refuses a member with `403` when no other group they match allows the request, while an omitted cell has no opinion and `default` decides. Then put `default` back: if the computer had no document before, delete it to return to the project's rules, as the tabs do. Otherwise set `default` to its earlier value, such as `"inherit"`, and keep the document. ```bash hoody computers proxy default set -c $COMPUTER_ID --default deny --if-match 'file:v' hoody computers proxy groups password set support -c $COMPUTER_ID \ --auth-username support --auth-password 'a-temporary-password' \ --salt 'salt' --if-match 'file:v' hoody computers proxy groups permissions set support terminal -c $COMPUTER_ID \ --access 1 --if-match 'file:v' hoody computers proxy groups permissions set support display -c $COMPUTER_ID \ --access 1 --if-match 'file:v' hoody computers proxy groups permissions set support files -c $COMPUTER_ID \ --access true --if-match 'file:v' # Afterwards hoody computers proxy groups delete support -c $COMPUTER_ID --if-match 'file:v' hoody computers proxy permissions delete -c $COMPUTER_ID --if-match 'file:v' ``` ```typescript await client.api.computers.proxy.setDefault(COMPUTER_ID, { default: 'deny' }, { ifMatch: 'file:v' }); await client.api.computers.proxy.setPasswordGroup(COMPUTER_ID, 'support', {username: 'support', password: 'a-temporary-password', algorithm: 'sha256', salt: 'salt'}, { ifMatch: 'file:v' }); await client.api.computers.proxy.setGroupPermission(COMPUTER_ID, 'support', {program: 'terminal', access: 1}, { ifMatch: 'file:v' }); await client.api.computers.proxy.setGroupPermission(COMPUTER_ID, 'support', {program: 'display', access: 1}, { ifMatch: 'file:v' }); await client.api.computers.proxy.setGroupPermission(COMPUTER_ID, 'support', {program: 'files', access: true}, { ifMatch: 'file:v' }); // Afterwards await client.api.computers.proxy.deleteGroup(COMPUTER_ID, 'support', { ifMatch: 'file:v' }); await client.api.computers.proxy.deletePermissions(COMPUTER_ID, { ifMatch: 'file:v' }); ``` ```bash curl -X PATCH "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/default" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{"default": "deny"}' curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/groups/support/password" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{"username": "support", "password": "a-temporary-password", "algorithm": "sha256", "salt": "salt"}' curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/permissions/support" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{"program": "terminal", "access": 1}' curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/permissions/support" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{"program": "display", "access": 1}' curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/permissions/support" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{"program": "files", "access": true}' # Afterwards curl -X DELETE "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions/groups/support" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "If-Match: file:v" curl -X DELETE "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "If-Match: file:v" ``` ' }, json: {default: 'deny'} }, { label: 'Add the group', method: 'PUT', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions/groups/support/password', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' }, json: {username: 'support', password: 'a-temporary-password', algorithm: 'sha256', salt: 'salt'} }, { label: 'Grant terminal', method: 'PUT', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions/permissions/support', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' }, json: {program: 'terminal', access: 1} }, { label: 'Grant display', method: 'PUT', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions/permissions/support', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' }, json: {program: 'display', access: 1} }, { label: 'Grant files', method: 'PUT', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions/permissions/support', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' }, json: {program: 'files', access: true} }, { label: 'Afterwards: remove the group', method: 'DELETE', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions/groups/support', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' } }, { label: 'Afterwards: delete the document', method: 'DELETE', target: 'https://api.hoody.com/api/v1/computers/COMPUTER_ID/proxy/permissions', bearerToken: 'HOODY_TOKEN', headers: { 'If-Match': 'file:v' } }, ]} > Run these links through a separate computer in a different project whose cURL URL stays reachable throughout setup and cleanup. The If-Match value must be the document's current `etag` (`file:v`). ### Partner tiers by token ```bash hoody computers proxy default set -c $COMPUTER_ID --default deny --if-match 'file:v' hoody computers proxy groups token set tier1_partners -c $COMPUTER_ID \ --header X-Api-Token --value 'partner-abc-tier1' --if-match 'file:v' hoody computers proxy groups token set tier2_partners -c $COMPUTER_ID \ --header X-Api-Token --value 'partner-def-tier2' --if-match 'file:v' hoody computers proxy groups permissions set tier1_partners http -c $COMPUTER_ID \ --access '[8080]' --if-match 'file:v' hoody computers proxy groups permissions set tier1_partners files -c $COMPUTER_ID \ --access true --if-match 'file:v' hoody computers proxy groups permissions set tier2_partners http -c $COMPUTER_ID \ --access '[80,3000]' --if-match 'file:v' hoody computers proxy groups permissions set tier2_partners files -c $COMPUTER_ID \ --access false --if-match 'file:v' ``` ```typescript await client.api.computers.proxy.setPermissions(COMPUTER_ID, { project: PROJECT_ID, computer: COMPUTER_ID, groups: { tier1_partners: {type: 'token', value: 'partner-abc-tier1', header: 'X-Api-Token'}, tier2_partners: {type: 'token', value: 'partner-def-tier2', header: 'X-Api-Token'}, }, permissions: { tier1_partners: {http: [8080], files: true}, tier2_partners: {http: [80, 3000], files: false}, }, default: 'deny' }, { ifMatch: 'file:v' }); ``` ```bash curl -X PUT "https://api.hoody.com/api/v1/computers/$COMPUTER_ID/proxy/permissions" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -H "If-Match: file:v" \ -d '{ "project": "'$PROJECT_ID'", "computer": "'$COMPUTER_ID'", "groups": { "tier1_partners": {"type": "token", "value": "partner-abc-tier1", "header": "X-Api-Token"}, "tier2_partners": {"type": "token", "value": "partner-def-tier2", "header": "X-Api-Token"} }, "permissions": { "tier1_partners": {"http": [8080], "files": true}, "tier2_partners": {"http": [80, 3000], "files": false} }, "default": "deny" }' ``` ' }} json={{project: 'PROJECT_ID', computer: 'COMPUTER_ID', groups: {tier1_partners: {type: 'token', value: 'partner-abc-tier1', header: 'X-Api-Token'}, tier2_partners: {type: 'token', value: 'partner-def-tier2', header: 'X-Api-Token'}}, permissions: {tier1_partners: {http: [8080], files: true}, tier2_partners: {http: [80, 3000], files: false}}, default: 'deny'}} bearerToken="HOODY_TOKEN" > Run this link through a separate computer in a different project whose cURL URL stays reachable. Writes both token groups in one request. The If-Match value must be the document's current `etag` (`file:v`). ### Permission shapes Team on an office IP, at project level: ```json { "groups": { "developers": { "type": "ip", "range": "203.0.113.0/24" } }, "permissions": { "developers": { "terminal": true, "display": true, "files": true, "http": [8080] } } } ``` Teams isolated by instance, on a computer running five terminals: ```json { "permissions": { "frontend_team": { "terminal": [1, 2], "display": 1, "http": [8080] }, "backend_team": { "terminal": [3, 4], "display": 2, "http": [8080] }, "ops_team": { "terminal": true, "display": true, "http": [8080] } } } ``` Least privilege: ```json { "permissions": { "api_users": { "http": [80], "terminal": false, "files": false, "display": false, "exec": false } } } ``` Either way in, because any group whose cell allows the request grants access: ```json { "groups": { "secure_access": { "type": "ip", "range": "203.0.113.0/24" }, "with_jwt": { "type": "jwt", "secret": "a-long-random-signing-key-with-32-plus-chars", "algorithm": "HS256", "sources": ["header:Authorization"] } }, "permissions": { "secure_access": { "http": [8080] }, "with_jwt": { "http": [8080] } }, "default": "deny" } ``` ## Links instead of headers Bookmarks, QR codes and email links cannot attach custom request headers. When you need a plain GET link, hoody-curl can wrap an authenticated request: [POST→GET wrapping](/kit/curl/#postget-wrapping). Zapier webhooks can also send headers directly. | Rule | Detail | |---|---| | Multiple headers | Repeat `header` once per header | | Write links | Each needs the current `etag` (`file:v`) in `If-Match` | ## Troubleshooting | Symptom | Cause | Fix | |---|---|---| | Denied unexpectedly | Group missing, or credentials or IP do not match | `GET .../proxy/permissions` and compare | | Denied on one instance | The group's value excludes it | `terminal: true` allows all; `terminal: 1` or `[1]` only instance 1; `"1-3"` instances 1 to 3 | | Denied, no group matches | `default` is `deny` | Add a matching group or change `default` | | `401` or a login prompt under `allow` | A `password` group has an applicable cell that is neither `null` nor `false`, and the caller is outside it | Send its credentials, or set that cell to `false` or delete it | | `403` under `allow` | The caller matches a group with an explicit, non-null cell that refuses the request, and no other matched group allows it | Change the cell, or delete it so `default` decides | | Differs from project rules | The computer document overrides | `GET /api/v1/computers/{id}/proxy/permissions` | | `403` on every URL | Effective `enable_proxy` is not `true` | Check both documents | | Anonymous requests get in | Effective `default` is `allow`: the computer's own, or the project's through `"inherit"` | Set `deny`, and check both documents | | `403` `CREDENTIAL_UNRESOLVED` | A candidate limit left a group's membership undecided, and that group affects the decision | Reduce definitions and copies; use `__Host-` names | | `403` `CREDENTIAL_UNRESOLVED`, even with a valid login | The request used all its login work | Reduce definitions and copies; use `__Host-` names | | `422` on a cell, such as `"exec": [1]` or `"notifications": [1, 2]` | Refused value: see [Access values](#access-values) and [Port grants](#port-grants) | Use an accepted value | | Question | Answer | |---|---| | Rotate a secret or token | Add a group with the new credential, update clients, verify, then delete the old group with the current `If-Match`: `DELETE /api/v1/projects/{id}/proxy/permissions/groups/{oldGroupName}` for a project group, or `DELETE /api/v1/computers/{id}/proxy/permissions/groups/{oldGroupName}` for a computer group | | See who accessed a computer | Not through permissions. Use the `logs` service ([proxy request and response logs](/api/proxy-logs/)), service-level logging, or MITM via hoody-exec | | Audit | `GET /api/v1/projects`, read each project's permissions, look for `0.0.0.0/0`, expired access and unused groups | | Why open by default | Sharing a URL is all the setup a collaborator needs |