Repository navigation
fix(s2-rm): reject a revoke whose object_type doesn't match (#123) - #132
Merged
Merged
Conversation
The session tracked open instructions by ID only, so a RevokeObject naming another control type passed the check. A queued instruction was revoked anyway, and one already passed on to the flow got OK without a REVOKED, as no control-type node holds it under that type. The session now keeps each open instruction's type and rejects a revoke whose object_type doesn't match with PERMANENT_ERROR. A PEBC revoke for an ID it doesn't know is still passed on to s2-pebc (#122). Closes #123.
There was a problem hiding this comment.
🟡 Changes recommended
The test table’s union of row shapes makes destructuring open fail type-checking with TS2339 because most rows lack that property.
1 open issue
What changed in this PR
This PR addresses #123 by tracking each open instruction’s type in the shared S2 session and rejecting revokes that name a different instruction type. Unknown PEBC instructions remain forwarded to s2-pebc, preserving the behavior discussed in #122.
Changes:
- Replace ID-only tracking with an instruction ID-to-type map.
- Update revoke tests with matching instruction fixtures and mismatched-type cases.
- Document the corrected behavior in the reference guide and changelog.
| File | Description |
|---|---|
test/lib/session.test.ts |
Share typed instruction fixtures and add mismatched-type revoke cases. |
src/lib/s2/session.ts |
Track instruction types and reject mismatched revokes. |
docs/S2_REFERENCE.md |
Document rejection of revokes naming another instruction type. |
CHANGELOG.md |
Record the revoke validation fix for s2-rm and s2-resource. |
Review effort: Balanced
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.

The session tracked open instructions by ID only, so a RevokeObject naming another control type passed the check. A queued instruction was revoked anyway, and one already passed on to the flow got OK without a REVOKED, as no control-type node holds it under that type.
The session now keeps each open instruction's type and rejects a revoke whose object_type doesn't match with PERMANENT_ERROR. A PEBC revoke for an ID it doesn't know is still passed on to s2-pebc (#122).
Closes #123.