Files
zeekay 45126f763c hanzo_iam: an OAuth validator that admits hanzo-sql tokens
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
2026-10-09 10:19:04 -07:00
..
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-05-29 21:52:35 +02:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-01-01 13:24:10 -05:00
2026-04-06 07:41:28 -04:00
…

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.