mirror of
https://github.com/floci-io/floci.git
synced 2026-11-25 23:00:59 -05:00
* feat(dsql): serve each cluster's database on the DSQL endpoint Each Aurora DSQL cluster gets a PostgreSQL 16 database in a Docker container, set up as DSQL's (the role admin owning public, repeatable read), and every cluster is served on one TLS endpoint where the server name picks the cluster. A connection is admitted as DSQL admits it, measured on AWS: an IAM token for the endpoint, DbConnectAdmin for admin, 5 seconds of grace past expiry, a long-term key only in its own account, IAM enforcement with the account's SCPs, and DSQL's SQLSTATE, text and hint for every refusal. A role other than admin is refused as an unmapped one, since role mappings come with AWS IAM GRANT in the next part. The startup is read as DSQL reads it: a dotted parameter is refused, and of options only -c name=value counts, the first for a name. The cluster is CREATING until its database answers; a multi-Region peer is ACTIVE after peering only once its database answers. A start that fails after the container exists removes it, a deletion Docker cannot finish leaves the cluster DELETING for the next start, and whether a cluster is wanted and its route change under one lock, so a deletion racing a start leaves no route. The data plane was first one PR; it is split by layer at the maintainer's request: this part (transport and admin), then AWS IAM GRANT and the other roles, then DSQL's dialect and limits. * refactor(postgres): speak PostgreSQL's wire protocol through one shared helper The DSQL endpoint brought a third copy of the startup parsing, message framing and ErrorResponse building that the RDS proxy's PostgresProtocolHandler and Redshift's PostgresWireDecoder each carried. They now go through core.common.PostgresWire: the startup packet and its parameters, reading and writing a message with its checked length, and the fields of an ErrorResponse or NoticeResponse. The length refusals keep the RDS proxy's wording, which its tests assert; Redshift's oversized-message refusal now reads the same way. Also from the review: the DSQL integration test makes its IAM users with EnforcementFixtures.createUser, which removes them after the test; the service test shares one ready-at-once provision stub; and every exception the endpoint and session swallow is named ignored, with the reason it is safe.