Skip to main content

glovebox-hosts

The one answer to "which host is this" that every part of glovebox uses: the egress proxy's verdict service, the launcher, the WebFetch hook, the session driver and the evals.

A host is compared in one spelling: ASCII only, surrounding whitespace removed, lowercased, and an IP literal in its standard form. A name that is not ASCII, or that starts or ends with a dot, is refused with HostError rather than folded, so two readers can never disagree about it.

>>> from glovebox_hosts import canonical_host, split_authority, granting_entries
>>> split_authority("[2001:DB8::1]:443")
('2001:db8::1', 443)
>>> granting_entries("API.example.com", ["example.com"])
['example.com']
>>> granting_entries("a.b.example.com", ["example.com"])
[]

A grant reaches the entry and one label below it, the depth one certificate wildcard covers. A bar (constraining_entries) reaches any depth. A grant may not name a *. wildcard over a public suffix, or over a name with one below it (suffix_below): grant_name_refusal says why, reading the Public Suffix List that tldextract bundles. A grant on a public suffix itself is allowed, and grant_is_exact tells the policy render to hold it to that one host. That is the package's one dependency, and it is imported only when a grant name is judged.

pod_grants reads a Kata pod's glovebox.dev/egress-grants annotation as every node reads it, so an admission webhook can refuse a pod at submission for the same reason the node would refuse it later. It returns the granted hosts at their tiers and the address grants, and raises GrantRefused with the node's own message for the first entry the node refuses. How wide an address grant may be is each node's own setting, so it is not checked here.

>>> from glovebox_hosts import GrantRefused, pod_grants
>>> pod_grants('["httpbin.org", {"host": "203.0.113.5:8443", "rw": true}]').hosts
{'httpbin.org': 'ro'}
>>> pod_grants('["*.amazonaws.com"]')
Traceback (most recent call last):
...
glovebox_hosts.GrantRefused: glovebox.dev/egress-grants: '*.amazonaws.com' is a wildcard over a name with the public suffix ...

Metadata

Release files for glovebox-hosts 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glovebox-hosts 0.4.0
File Size Uploaded Provenance
glovebox_hosts-0.4.0.tar.gz 13.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for glovebox-hosts 0.4.0
File Interpreter ABI Platform
glovebox_hosts-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / glovebox_hosts-0.4.0.tar.gz

Download URL glovebox_hosts-0.4.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
103b17a9eb1801e506634f8fdd20dfd1d9e0082729df2610bec6dae878fcea47
BLAKE2b-256 checksum
How to use checksums
23a484d371321d61e6983a75d70b530cc6ffff0a1b157ca9b0bfbba6a00a64c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / glovebox_hosts-0.4.0-py3-none-any.whl

Download URL glovebox_hosts-0.4.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac830a3924b0ef477f47fa75cbc153f1ba9b92d00293df4546afcc4163bfb7c6
BLAKE2b-256 checksum
How to use checksums
e8c8c2ebf62cb19f22dbb82e22e70e63d77f157e3fcc4cdd9b448270fc03d4bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for glovebox-hosts 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page