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
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.