Repository navigation
Description
Summary
RotateSecret reads exactly one of its seven request parameters, omits a response member AWS publishes and every one of AWS's four samples returns, and never refuses a rotation AWS would refuse. The result is a 200 that reports rotation configured when nothing was configured — state divergence, not merely a thin response.
Substrate's handler (emulator/secretsmanager_plugin.go:682-713) decodes only SecretId, sets secret.RotationEnabled = true, and answers {"ARN", "Name"}.
1. The response omits VersionId
API_RotateSecret's Response Syntax has three members:
{
"ARN": "string",
"Name": "string",
"VersionId": "string"
}
VersionId— "The ID of the new version of the secret." Type: String. Length Constraints: Minimum length of 32. Maximum length of 64.
All four sample responses on the page return it. Substrate returns two of the three, so a caller reading VersionId — the handle to the version rotation just created — gets nothing.
And the value is derivable from the request, not minted. Each of AWS's four examples states it in the same words:
"The
ClientRequestTokenfield becomes theVersionIdof the new version created during the rotation."
ClientRequestToken is Required: No for an SDK caller, but the page is explicit about the raw-HTTP case substrate serves:
"If you generate a raw HTTP request to the Secrets Manager service endpoint, then you must generate a
ClientRequestTokenand include it in the request."
So echoing the request's token is both correct and deterministic — a value traceable to the request rather than to a minter, which is the whole point of #856's class. What to do when a caller omits it anyway is substrate's reading and should be recorded as such.
2. Six request parameters are read by nothing, and two of them are DescribeSecret response members
RotationLambdaARN, RotationRules, RotateImmediately, ClientRequestToken, ExternalSecretRotationRoleArn and ExternalSecretRotationMetadata are all silently discarded.
Two of those are members API_DescribeSecret publishes and #930 has just documented as absent-because-unmodelled: RotationLambdaARN and RotationRules. Recording the rotation intent is what makes DescribeSecret's report accurate, and it is squarely in scope — capturing recorded intent is the boundary CLAUDE.md draws, as against executing the rotation function, which is not. It also gives RotationRules's documented omission tier something to be true about: "If the secret never had rotation turned on, this field is omitted."
ExternalSecretRotationRoleArn and ExternalSecretRotationMetadata belong to the managed-external-secret integration substrate models nothing of; they are named here for completeness and are not in scope for this issue.
3. A rotation AWS refuses answers 200 — and writes state
API_RotateSecret publishes InvalidRequestException/400 with three causes, verbatim:
A parameter value is not valid for the current state of the resource. Possible causes:
- The secret is scheduled for deletion.
- You tried to enable rotation on a secret that doesn't already have a Lambda function ARN configured and you didn't include such an ARN as a parameter in this call.
- The secret is managed by another service, and you must use that service to update it.
The second cause is exactly what substrate does on every call: it enables rotation on a secret with no rotation function, having been given no RotationLambdaARN. So the nominal path in substrate is the refused path in AWS.
That makes this the same shape as #949 rather than a plain missing error: substrate does not merely skip a refusal, it writes RotationEnabled = true, and DescribeSecret then reports rotation enabled for a secret AWS would have left untouched. A consumer's error-handling branch for "configure rotation without a function" is unreachable in substrate, and its success branch fires where AWS fails.
The first cause depends on modelling the recovery window, which is filed separately. The third is out of scope with the managed-external-secret members.
Acceptance criteria
-
RotateSecret's response carriesVersionId, echoing the request'sClientRequestToken, with the "becomes theVersionId" citation recorded and the omitted-token behaviour recorded as substrate's reading. -
RotationLambdaARNandRotationRulesare recorded on the secret and reported byDescribeSecret, keeping fix(secretsmanager): ResourceNotFoundException is 400, not 404, and DescribeSecret emits members AWS omits #930's omit-vs-null tiers intact —RotationRulesabsent until rotation is turned on, per its own "this field is omitted". -
RotateSecretanswersInvalidRequestException/400 when no rotation function is configured and none is supplied, and writes no state in that case; the message names which of AWS's three causes applies. -
RotateImmediately's default (true, per the page) is recorded, whether or not any observable behaviour turns on it. - A test asserts, over the wire, that a bare
RotateSecretis refused and thatDescribeSecretstill reportsRotationEnabledasnullafterwards — the state-divergence half, which a status-only assertion would miss. - A test asserts the returned
VersionIdequals theClientRequestTokensent. -
docs/services.md's Secrets Manager section records the refusal and theVersionIdderivation;CHANGELOG.mdstates the compatibility break (a bareRotateSecretthat returned200now returns400).
Provenance
All quotations above are verbatim from API_RotateSecret and were fetched for this issue. ClientRequestToken length is 32–64, matching VersionId's, which corroborates the identity the examples state.
Activity
fix(secretsmanager): four operations accepted a secret scheduled for …