Managed names
Reserved names another Xeonr product keeps in your team, and how a product creates them.
Some Xeonr products are built on Burrow. Home Assistant cloud, for example, gives each Home Assistant instance a public URL. Such a product can keep a reserved name in your team on your behalf: the name, its custom domain, the credential its agent connects with, and for a TCP or UDP name a public port. That name is managed by the product.
What your team sees
A managed name appears with the team's other reserved names, marked Managed
by <product> in the console and managed by <product> in
burrow names ls. It belongs to your team: it disappears with the team, and
its traffic shows in the team's history like any other.
What differs is who may configure it.
| Team members | The managing product | Team admins | |
|---|---|---|---|
| See it, its traffic and its domains | yes | yes | yes |
| Change its policy, capture mode, retention or target port | — | yes | — |
| Add or verify a custom domain on it | — | yes | — |
Serve it with burrow http --name | — | its own agent only | — |
| Mint or revoke its agent credentials | — | yes | — |
| Delete it, or remove one of its domains | — | yes | yes |
Changing a managed name from the console, the CLI or the API answers
permission_denied and names the product, so you know where to make the change
instead. burrow http --name <it> is refused before anything connects.
Deleting stays with the team's admins. The team keeps the last word over what is in it. Deleting a managed name also removes its custom domains, revokes its agent credentials and closes its tunnel if one is open. The product will notice that the name is gone, and treat it as removed by your team.
Managed names do not count against your team's reserved-name limit. The
managing product limits how many it keeps. ListReservations reports
quota_used beside total for this reason: "11 of 25" is quota_used of
quota.
For a product: managing names
Everything here is xeonr.burrow.v1.ManagedReservationService on
https://burrow.prod.wtf. It has two kinds of caller, and no method serves
both.
Acting for a person
A person is using your product, and your API acts for them. This follows the platform's on-behalf-of standard.
- Your product's sign-in requests
burrow:managed:read,burrow:managed:editandauth:teams:read. The person consents to them alongside your own scopes. - Your API exchanges the person's access token for one audienced to Burrow.
This is an RFC 8693 token exchange at
auth.xeonr.io. Theclient_idis Burrow's exchange receiver, and you request the scopes the call needs plusauth:teams:read. Without that scope the exchanged token carries no team memberships, so Burrow cannot see the person's role in any team. Every call is then refused withpermission_denied, and the message names the missing scope. - Call Burrow with the exchanged token. Burrow sees the person as the subject and your product as the actor. Your product's clients must be registered with Burrow as delegators. Ask the platform team.
The person's own role still applies. They need editor in the team to
create, change or delete anything, and team membership to read. Your product
reaches only the names it manages. Another product's name, or one of the
team's own, is not_found. A name created this way records your product as
managed_by, and that never changes.
| Method | Scope | Does |
|---|---|---|
CreateManagedReservation | burrow:managed:edit | Reserve a name, optionally with a custom domain in the same call |
GetManagedReservation | burrow:managed:read | The name and its domains |
GetManagedReservationTransfer | burrow:managed:read | Bytes through the name's tunnel over a window, as GetTransfer counts them; never from before the name was reserved |
UpdateManagedReservation | burrow:managed:edit | policy, capture_mode, retention_days, target_port, by update_mask |
DeleteManagedReservation | burrow:managed:edit | Release it, with its domains and agent credentials |
CreateManagedDomain | burrow:managed:edit | Add a custom domain; answers with the TXT and CNAME records |
VerifyManagedDomain | burrow:managed:edit | Check the TXT record and route the domain |
DeleteManagedDomain | burrow:managed:edit | Remove a domain |
CreateAgentCredential | burrow:managed:edit | Mint an agent credential (below); the secret is returned once |
ListAgentCredentials | burrow:managed:read | List a name's credentials; secrets are never returned |
RevokeAgentCredential | burrow:managed:edit | Revoke one |
CreateManagedPortLease | burrow:managed:edit | Pin a pool port to a TCP or UDP name (below); idempotent |
DeleteManagedPortLease | burrow:managed:edit | Return the name's pinned port to the pool |
curl -sS https://burrow.prod.wtf/xeonr.burrow.v1.ManagedReservationService/CreateManagedReservation \
-H "Authorization: Bearer $EXCHANGED_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"team":"core-infra","name":"ha-7f3c2a","capture_mode":"CAPTURE_MODE_METADATA","domain":"home.example.com"}'capture_mode defaults to full capture, as it does for every name. A product
whose traffic carries passwords or tokens should set CAPTURE_MODE_METADATA
or CAPTURE_MODE_OFF. A policy that does not parse is invalid_argument
rather than stored.
With nobody present
For reconciling your own records against Burrow's, and for tearing everything
down when a team turns your product off, call as your product's service
account. It must hold burrow:managed:reconcile. That scope can be granted
only to a service account, through its binding to Burrow. On these methods
team is a team URN, because a service account belongs to no team.
| Method | Does |
|---|---|
ListManagedReservations | Your names in one team, or with team empty, in every team |
ReleaseManagedReservation | Release one of your names. released is false when there was nothing to release |
TeardownManagedReservations | Release every name you manage in one team. Idempotent |
None of these touch the team's own names or another product's.
Pool ports
Burrow's TCP and UDP tunnels share one pool of public ports, at
tcp.brw.xnr.app and udp.brw.xnr.app. A CLI tunnel leases a port for as
long as it is up, and keeps it for 72 hours afterwards. A product that runs a
workload, such as a game server, needs more than that: an endpoint that
stays the same across restarts for as long as the workload exists.
For that, reserve a TCP or UDP managed name, then pin a port to it:
curl -sS https://burrow.prod.wtf/xeonr.burrow.v1.ManagedReservationService/CreateManagedPortLease \
-H "Authorization: Bearer $EXCHANGED_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"team":"core-infra","reservation":"mc-survival"}'
# {"lease":{"port":20040,"pinned":true,"managedBy":"your-product",…},"url":"tcp://tcp.brw.xnr.app:20040"}- The port is the name's until the name is released, or until
DeleteManagedPortLeasereturns it. It never expires. - An agent that registers for the name, with the name's agent credential, is always given this port. Reconnecting or restarting does not move it.
- Calling
CreateManagedPortLeaseagain answers with the same port. - An HTTP name is refused with
failed_precondition. A full pool isresource_exhausted. - The team sees the port among its held ports, marked as yours. The team
cannot release it through
DeletePortLease. A team admin who deletes the name returns the port to the pool with it.
Agent credentials
An agent credential lets a long-lived agent bring one managed name online, for example inside Home Assistant on somebody's own hardware, without holding anybody's sign-in.
- It is an API key,
xk_…, owned by the reservation itself. It can open that reservation's tunnel and nothing else. Every other API method refuses it, and so doesburrow connect. - The agent presents it exactly as the CLI presents a token:
Authorization: Bearer xk_…on the agent WebSocket atwss://connect.brw.xnr.app/v1/agent. With the CLI,BURROW_TOKEN=xk_… burrow http 8123works. - The tunnel always serves the reservation's name with the reservation's policy and capture mode. A policy the agent sends is ignored. A different name, or a different protocol, is refused. The agent may leave the name out.
- It dies with the reservation. When the name is deleted, its open tunnel is closed and the credential is refused from then on. Revoking a credential closes the session it opened and refuses its reconnect. A session another credential opened on the same name stays up.