mirror of
https://github.com/hanzoai/sql.git
synced 2026-11-15 19:38:30 +00:00
A connection that chooses the oauth method presents a token signed RS256 by the sql key. Trust is the <kid>.pem public files in hanzo_iam.dir, read on every connection, so a removed file revokes its key at once; nothing here calls IAM. The key must be RSA of 2048 bits or more, in a file of at most 16 KiB. The token is at most 8192 bytes, and each of its three parts decodes into a buffer with its own capacity, so the size check is not the only bound. iss is https://hanzo.id, aud holds hanzo-sql, typ is sql (a claim; the JOSE header's typ is not read), act is absent, sub is sql:<role>, exp and iat are required, exp is at most 60 s past, iat and nbf (optional) at most 60 s ahead, and exp - iat is at most 600 s. The claims are not parsed until the signature verifies. JSON is read with PostgreSQL's jsonapi, escapes decoded, and a member a check names may appear once however it is spelled. authn_id is the role, and the connection is authorized only when it equals the role requested (delegate_ident_mapping=1). A refusal logs one reason from a fixed list and never names the client's role; a key file that cannot be read is also named by its path, for the operator. Built with PGXS against PostgreSQL 18 and copied into the image. The TAP test signs tokens with keys it makes and checks each refusal by the reason logged: the size bound at 8192 and 8193 bytes, the key rules (EC, DSA, 1024-bit RSA, private key, certificate, empty, directory, 16 KiB and over), and JSON escapes in member names and values. make fuzz builds a libFuzzer target over the parser, run with -max_len=9500 from seeds on the bound. CI does not run either; LLM.md says so. Claude-Session: https://claude.ai/code/session_01SCPMGSQsLNF2YtHFL4bwyp
25 lines
1.2 KiB
YAML
25 lines
1.2 KiB
YAML
# ghcr.io/hanzoai/sql — PostgreSQL 18 with pgvector, pg_cron, pg_documentdb and
|
|
# this repo's own contrib/zap_fdw and contrib/hanzo_iam. The Dockerfile IS the
|
|
# gate: it compiles zap_fdw and hanzo_iam from this tree and bakes conf/ and
|
|
# docker-entrypoint-initdb.d/, so a break in any of them fails the build. That
|
|
# is also exactly the path
|
|
# .github/workflows/deploy.yml filters on, and it is a full extension toolchain
|
|
# build (libbson, Intel decimal math, pcre2, documentdb) — slow by nature.
|
|
#
|
|
# version: is required here and cannot be derived. imgver reads a repo's own
|
|
# manifest, and this tree has none it recognises — no package.json, Cargo.toml,
|
|
# VERSION or pyproject.toml — so the first run died with "no version for
|
|
# ghcr.io/hanzoai/sql. We don't ship shas." It tracks PG_MAJOR, which is what
|
|
# the image actually ships: the runtime stage is FROM postgres:18-bookworm.
|
|
# NOT configure.ac's 19beta1 — that is the vendored PostgreSQL source fork,
|
|
# which this image does not build and does not run. imgver takes
|
|
# max(declared, published) + a patch, so the series moves on its own from here.
|
|
#
|
|
# No deploy:. universe pins the live tag.
|
|
version: 18.0.0
|
|
images:
|
|
- name: sql
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
repo: ghcr.io/hanzoai/sql
|