Repository navigation
fix(#756): render Glue responses from the published shape - #1310
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
AccountIDand
Region— neither hasomitempty, so both were unconditional — andever_taggedonce theresource had been tagged.
API_Database,API_Table,API_Connection,API_Crawler,API_Joband
API_JobRunpublish none of the three.A new
emulator/glue_wire.goprojects each record onto its published shape, on the patternecr_wire.goestablished (#1090) andefs_wire.go(#1304) andecs_wire.go(#1309) followed.Twenty-one baseline lines discharged — the largest single block left on the issue after ECS:
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:
GlueDatabaseCreatedAtCreateTimeAPI_DatabaseGlueTableCreatedAtCreateTimeAPI_TableGlueConnectionCreatedAtCreationTimeAPI_ConnectionGlueCrawlerCreatedAtCreationTimeAPI_CrawlerGlueJobCreatedAtCreatedOnAPI_JobGlueJobRunStartedOn,CompletedOnAPI_JobRun— already rightSo on five records out of six the stored name was a near-miss of a real member, and a caller
reading
CreateTimeoff a substrate response found nothing while the value sat beside it under aname 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'sinstance of #1305, which still stands for ACM, Redshift Data and Firehose. Every one is
Required: Noand is a*EpochSecondsrather than a bare one, because,omitemptyis inert on astruct type and a zero
EpochSecondsmarshals as JSONnull.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 itfrom 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 isGetTags/TagResource/UntagResource, whichsubstrate 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 thedatabase resides" — which
API_DatabaseandAPI_Tablepublish andAPI_Connection,API_Crawler,API_JobandAPI_JobRundo not. So a database and a table still report the account under itspublished 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:Get*andGet*s) that no bookkeeping member appears, thatthe published timestamp name is present and is a JSON number, and that no
ArnorTagsappears — every absence assertion anchored on a member that must be present, so a body that
dropped the whole record cannot pass by answering nothing;
TagResourceand anchored on aGetTagsresponsefirst, because
ever_taggedis,omitemptyand an absence assertion on an untagged record is thevacuous one fix(#756): render EFS responses from the published shape #1304 shipped before it was caught;
TestGlueWire_ProjectionLeavesTheRecordIntactreads all six records back out of state and assertsAccountID,Region,CreatedAt,Arn,TagsandEverTaggedare still persisted — thetagging plugin's
scanGlueDatabasesreads three of them across the service boundary;TestGlueWire_UnsetTimestampIsOmittedRatherThanNullcovers 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 includingever_tagged:trueand the RFC3339CreatedAt. All 36 changed plugin lines and all ofglue_wire.goare covered.scripts/check-wire-bookkeeping.shneeds no per-site exclusion, unlike ECS: every projectedtimestamp 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,ArnorTagsoff a Glue response body mustchange.
CreatedAtis nowCreateTime/CreationTime/CreatedOnper the table above and is anepoch-seconds number rather than an RFC3339 string; the account is
CatalogIdon a database and atable 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 runreplays as before, and the Resource Groups Tagging API still reports a Glue resource's tags.
docs/services.mdalso corrects theGetJobRunrow, which claimed a transition toSUCCEEDEDafter describe.
StartJobRunstores the runSUCCEEDEDwith both timestamps set andgetJobRunmutates nothing, so a wait loop passes on its first observation — the position the EMR Serverless
section already states for the same behaviour.
Refs #756