Expand description
An in-process stand-in for the AWS surface this deployment talks to.
The AWS interactions in this workspace are its own code end to end:
crate::route53 signs its own SigV4 requests and reads IMDSv2 itself,
with no AWS SDK anywhere in the dependency graph. That makes every one of
them reachable from a test with no cloud account, provided there is
something on the other end of the wire — which is what this module is.
Two pieces, matching the two AWS services that code calls:
FakeImdsanswers the instance metadata service’s credential read, hands out a fresh access key id per read, and can expire the credential it last issued — on command, or after a set number of API calls, so a single long-running operation can outlive the credential it started with.FakeAwsis a Route53 hosted zone that holds record sets, appliesChangeResourceRecordSetsbatches atomically, answersListResourceRecordSetsa page at a time, and takes a change throughPENDINGbeforeINSYNC. It refuses what the real service refuses: aCREATEonto a name and type it already holds, aDELETEwhose values do not match, and a batch that would push the zone past its record-set quota. It can be told to throttle, to return a server error, or to drop the connection for a set number of calls.
route53_provider joins them: a Route53Dns whose transport is a
FakeAws, with retry and polling intervals wound down to milliseconds
so a test that drives a retry or a PENDING change resolves it in
ordinary test time. Nothing here sleeps for longer than that, and no
outcome depends on how long anything took.
Behind the aws-fake feature, which a crate turns on as a
dev-dependency — didbot-dns = { workspace = true, features = ["aws-fake"] } under [dev-dependencies] — so that a production build
links none of it.
The ACME side of a deployment has its own fake, FakeAcmeServer in
didbot-tls’s tests/support, which speaks instant_acme’s HTTP client
trait rather than AWS’s wire format. A DNS-01 test wants both: that one
for the CA, this one for the zone the challenge is written into.
Structs§
- FakeAws
- A Route53 hosted zone, in process.
- Fake
Imds - The instance metadata service, as far as
InstanceCredentialsis concerned: a source of temporary credentials, each with a stated expiry. - Imds
State 🔒 - Pending
Change 🔒 - A change accepted by the zone and not yet
INSYNC. - Record
Set 🔒 - One record set in the fake hosted zone.
- Wire
Change 🔒 - One
<Change>out of aChangeResourceRecordSetsbody. - Zone
State 🔒
Functions§
- error_
body 🔒 - escape 🔒
- normalize 🔒
- A record set name as the zone keys it: lowercased, no trailing dot.
- parse_
changes 🔒 - route53_
provider - A
Route53Dnsbacked byaws, wound down to test timings. - tag 🔒
- Text of the first
<tag>at or afterfrom, and the offset past it. - unescape 🔒
Type Aliases§
- Key 🔒
- A record set’s identity, and the order a zone listing walks: name first, then type.