Skip to content

fix(#756): render Glue responses from the published shape - #1310

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/756-glue-wire-projection
Oct 1, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/756-glue-wire-projection

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

All six Glue records were answered to the caller as stored, so each of the twelve operations that
reports a database, table, connection, crawler, job or job run carried substrate's own AccountID
and Region — neither has omitempty, so both were unconditional — and ever_tagged once the
resource had been tagged. API_Database, API_Table, API_Connection, API_Crawler, API_Job
and API_JobRun publish none of the three.

A new emulator/glue_wire.go projects each record onto its published shape, on the pattern
ecr_wire.go established (#1090) and efs_wire.go (#1304) and ecs_wire.go (#1309) followed.
Twenty-one baseline lines discharged — the largest single block left on the issue after ECS:

before:  319 declared, 59 projected across 25 records, 260 still reachable
after:   319 declared, 80 projected across 31 records, 239 still reachable

Glue is where the leak is worst

Not merely an extra member. Substrate stores one creation timestamp field on every record, and Glue
publishes that timestamp under four different names:

record substrate published authority
GlueDatabase CreatedAt CreateTime API_Database
GlueTable CreatedAt CreateTime API_Table
GlueConnection CreatedAt CreationTime API_Connection
GlueCrawler CreatedAt CreationTime API_Crawler
GlueJob CreatedAt CreatedOn API_Job
GlueJobRun StartedOn, CompletedOn same API_JobRun — already right

So on five records out of six the stored name was a near-miss of a real member, and a caller
reading CreateTime off a substrate response found nothing while the value sat beside it under a
name AWS does not have.

Those five also rendered as RFC3339 strings where Glue's JSON protocol publishes an epoch-seconds
number — API_GetDatabase's Response Syntax is literally "CreateTime": number. This closes Glue's
instance of #1305, which still stands for ACM, Redshift Data and Firehose. Every one is
Required: No and is a *EpochSeconds rather than a bare one, because ,omitempty is inert on a
struct type and a zero EpochSeconds marshals as JSON null.

Two members AWS publishes on no Glue shape

Deciding a response's membership is what surfaced them, and neither can be carried into a type whose
whole purpose is to hold only published members:

  • Arn, declared on five of the six records. No Glue shape has the member. A consumer builds it
    from the account, the Region and the name, which is what the real API requires of it — and the
    SDK's own decoder was discarding it anyway for want of a field.
  • Tags, declared on four. Glue's tag surface is GetTags/TagResource/UntagResource, which
    substrate implements, and that is the only place a tag is observable.

Where the leaked account legitimately goes is CatalogId — "the ID of the Data Catalog in which the
database resides" — which API_Database and API_Table publish and API_Connection, API_Crawler,
API_Job and API_JobRun do not. So a database and a table still report the account under its
published name, and the other four report none. That is the move #1304 made for EFS's OwnerId.

Provenance

Every member, its optionality and its published name come from that shape's own AWS reference page,
read at implementation time — including the four pages confirmed to publish no CatalogId.
Nothing is borrowed by analogy from a neighbouring shape.

What is pinned

Seven new tests in emulator/glue_wire_test.go, one per record plus two cross-cutting:

  • each asserts over both its sites (Get* and Get*s) that no bookkeeping member appears, that
    the published timestamp name is present and is a JSON number, and that no Arn or Tags
    appears — every absence assertion anchored on a member that must be present, so a body that
    dropped the whole record cannot pass by answering nothing;
  • the four taggable records are tagged through TagResource and anchored on a GetTags response
    first, because ever_tagged is ,omitempty and an absence assertion on an untagged record is the
    vacuous one fix(#756): render EFS responses from the published shape #1304 shipped before it was caught;
  • TestGlueWire_ProjectionLeavesTheRecordIntact reads all six records back out of state and asserts
    AccountID, Region, CreatedAt, Arn, Tags and EverTagged are still persisted — the
    tagging plugin's scanGlueDatabases reads three of them across the service boundary;
  • TestGlueWire_UnsetTimestampIsOmittedRatherThanNull covers the arm no request reaches.

Negative control run: with the twelve sites reverted to answering the record directly, every one
of the twelve fails, and GetDatabase's failure output shows all six members present including
ever_tagged:true and the RFC3339 CreatedAt. All 36 changed plugin lines and all of
glue_wire.go are covered.

scripts/check-wire-bookkeeping.sh needs no per-site exclusion, unlike ECS: every projected
timestamp is renamed to its published name, so no Glue wire field collides with the five names the
awk matches.

Compatibility

A consumer reading AccountID, Region, CreatedAt, Arn or Tags off a Glue response body must
change. CreatedAt is now CreateTime/CreationTime/CreatedOn per the table above and is an
epoch-seconds number rather than an RFC3339 string; the account is CatalogId on a database and a
table and is not reported on the other four; an ARN is built from the account, the Region and the
name; tags come from GetTags. The stored records are unchanged, so an existing recorded run
replays as before, and the Resource Groups Tagging API still reports a Glue resource's tags.

docs/services.md also corrects the GetJobRun row, which claimed a transition to SUCCEEDED
after describe. StartJobRun stores the run SUCCEEDED with both timestamps set and getJobRun
mutates nothing, so a wait loop passes on its first observation — the position the EMR Serverless
section already states for the same behaviour.

Refs #756

All six Glue records were answered to the caller as stored, so each of the
twelve operations that reports a database, table, connection, crawler, job or
job run carried AccountID and Region unconditionally and ever_tagged once the
resource had been tagged. API_Database, API_Table, API_Connection, API_Crawler,
API_Job and API_JobRun publish none of the three.

emulator/glue_wire.go projects each record onto its published shape, on the
pattern ecr_wire.go established (#1090). Twenty-one baseline lines discharged:
260 still reachable to 239.

Glue is where the leak is worst, because it is not merely an extra member.
Substrate stores one creation timestamp field on every record, and Glue
publishes that timestamp under four different names — CreateTime on
API_Database and API_Table, CreationTime on API_Connection and API_Crawler,
CreatedOn on API_Job — so on five records out of six the stored name was a
near-miss of a real member, and a caller reading CreateTime found nothing while
the value sat beside it. Only API_JobRun's StartedOn/CompletedOn were already
spelled right.

The same five rendered as RFC3339 strings where Glue's JSON protocol publishes
an epoch-seconds number; API_GetDatabase's Response Syntax is literally
"CreateTime": number. That closes Glue's instance of #1305, which still stands
for ACM, Redshift Data and Firehose. Every member is Required: No and is a
*EpochSeconds rather than a bare one, since `,omitempty` is inert on a struct
type and a zero EpochSeconds marshals as null.

Deciding a response's membership surfaced two members AWS publishes on no Glue
shape at all: Arn, on five of the six records, and Tags, on four. Glue's tag
surface is GetTags/TagResource/UntagResource, and an ARN is built from the
account, the Region and the name, which is what the real API requires of a
consumer. Where the leaked account legitimately goes is CatalogId, which
API_Database and API_Table publish and the other four shapes do not — the move
#1304 made for EFS's OwnerId.

The twenty-one fields stay on the records: a projection changes the response and
leaves the state a replay reads back alone. A new test reads all six records out
of state to pin that, since scanGlueDatabases reads Arn, Tags and EverTagged
across the service boundary. No per-site exclusion is needed in
check-wire-bookkeeping.sh — every projected timestamp is renamed to its
published name, so no wire field collides with the five names the awk matches.

docs/services.md also corrects the GetJobRun row, which claimed a transition to
SUCCEEDED after describe. StartJobRun stores the run SUCCEEDED with both
timestamps set, and getJobRun mutates nothing, so a wait loop passes on its
first observation.

Refs #756
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit dd27115 into main Oct 1, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the fix/756-glue-wire-projection branch October 1, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant