Repository navigation
fix(ir): keep the redaction an overridden declaration asks for - #1355
Open
OmarAlJarrah wants to merge 8 commits into
Open
OmarAlJarrah wants to merge 8 commits into
OmarAlJarrah wants to merge 8 commits into
Conversation
A flattened member took every facet but Required from the one declaration it took, so a composed model whose later conjunct redeclared a field without a redaction printed it in the clear, though an earlier conjunct asked for it to be hidden. For allOf of M1 (f, a password) and M2 (f, a string), the member f took M2's declaration and was not secret. FlatProperty gains Secret, computed as Required is: true where any declaration is Secret, or is of a type that is Sensitive or whose Base reaches one, since Property.Secret already says a value of a sensitive type is redacted whether or not it is set. docs/ir/models.md states the rule beside requiredness. FlatProperty is not part of the encoded document, so IRVersion does not move.
OmarAlJarrah
added a commit
that referenced
this pull request
Nov 2, 2026
The plan read a member's declarations itself because the flattening dropped a redaction an overridden declaration asked for. #1355 gives ir.FlatProperty a Secret that accumulates as Required does, so TypePlan.Redacted reads that instead.
2 of 3 tasks
…nto fix/ir-flattened-secret
#1229 listed, under extension-promotion's status, that a flattened member reads no redaction off a declaration it overrides. FlatProperty.Secret now accumulates over every declaration, so the item no longer holds.
5 of 6 tasks
…nto fix/ir-flattened-secret
…nto fix/ir-flattened-secret
5 of 6 tasks
17 tasks done
…nto fix/ir-flattened-secret
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.
Summary
ir.FlattenedPropertiesgives a composed model one member per wire name, and the member took every facet butRequiredfrom the one declaration it took. A redaction is such a facet. So a model whose later conjunct redeclares a field without one printed that field in the clear, though an earlier conjunct asked for it to be hidden:Both's memberftookM2's declaration and was not secret.FlatPropertygainsSecret, computed asRequiredis: true where any of the member's declarations asks for redaction. A declaration asks for it when it isSecret, or when its type isSensitiveor has aBasethat reaches a sensitive type. That second clause carries outProperty.Secret's own contract, that a value of a sensitive type is redacted whether or not the use says so.docs/ir/models.md#the-flatteningstates the rule beside requiredness, so a consumer reads the member'sSecretinstead of conjoiningOverriddenitself, which is the alternative the issue weighed and which leaves every emitter to remember it.FlatPropertyis a derived value, not part of the encoded document, soIRVersiondoes not move and no golden changes.On the golden spec at main this case does not occur. On #1229's branch, which gives a
$refthe redaction its target asks for, the issue's comment counts four members where an overridden declaration redacts and the taken one does not. Each is a failure envelope'sresulttaking a token declaration's place.Closes #1211
Stack
Base: #1354 (correlation keys), on #1351 and the emitter-design stack. Merge in order.
#1340 (redaction and stability tiers in the emitter design, based on #1229) read the declarations itself because the flattening did not carry this. It now reads
FlatProperty.Secret(commit 5fb3d7a there), and its body names this PR.#1229 (open) adds an
extension-promotionstatus item todocs/compilers/openapi.mdsaying a flattened member reads no redaction off a declaration it overrides (#1211). That stops being true here. Whichever of the two lands second drops the item.Test plan
go test ./ir -run TestFlattenedProperties. The newTestFlattenedProperties_Secretcovers four cases: an overriddenSecretdeclaration; a declaration of a sensitive scalar; sensitivity reached through a scalar's and a model'sBase; and aBasecycle, a list, a missing type and a typed-nil entry, which ask for none.Secretdropped, its type's sensitivity dropped, only the taken declaration read, the modelBasenot followed, and the chain bound cut to one step.fis owned byM2, has one overridden declaration, and issecret=true.mainor the base.