Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(orchestration): harden exported patterns #10470

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

erights
Copy link
Member

@erights erights commented Nov 13, 2024

closes: #XXXX
refs: #XXXX

Description

orchestration/src/typeGuards was defining and exporting some patterns as just unhardened object literals. This is locally wrong, since these are not valid patterns (or even passables) until hardened. The only reason these errors were uncaught must be because they were then used in a context which happened to harden them before they were used in a context where they were validated as patterns or passables.

Started as a drive-by of #10456 , where I import some of these patterns for usage elsewhere.

Security Considerations

defensive hardening is good

Scaling Considerations

none

Documentation Considerations

one less thing we would need to explain

Testing Considerations

In theory, a test could have revealed the bug that these were exported unhardened. But IMO, such tests would only be too much noise. We should just fix these. But this PR only fixes these in this one file. I don't know how many others there are.

Upgrade Considerations

In theory, it is possible that some importing code somewhere accidentally replies on these being unhardened, perhaps because it mutates one in place before using it, corrupting use by all other importers. If so, this PR will break such uses, which is good, because the silent corruption is a worse surprise than a new noisy error.

Copy link

cloudflare-workers-and-pages bot commented Nov 13, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5943756
Status: ✅  Deploy successful!
Preview URL: https://1027f5b3.agoric-sdk.pages.dev
Branch Preview URL: https://markm-orch-type-guards.agoric-sdk.pages.dev

View logs

@erights erights marked this pull request as ready for review November 13, 2024 20:34
@erights erights requested a review from a team as a code owner November 13, 2024 20:34
packages/orchestration/src/typeGuards.js Outdated Show resolved Hide resolved
@erights erights added the automerge:squash Automatically squash merge label Nov 13, 2024
@turadg turadg added automerge:rebase Automatically rebase updates, then merge and removed automerge:squash Automatically squash merge labels Nov 14, 2024
@erights erights removed the automerge:rebase Automatically rebase updates, then merge label Nov 14, 2024
@erights erights force-pushed the markm-orch-type-guards branch 3 times, most recently from cd068e6 to 52db2ee Compare November 14, 2024 23:14
@erights erights self-assigned this Nov 14, 2024
@erights erights added the automerge:squash Automatically squash merge label Nov 14, 2024
@mergify mergify bot merged commit 47bebb8 into master Nov 15, 2024
81 checks passed
@mergify mergify bot deleted the markm-orch-type-guards branch November 15, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:squash Automatically squash merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants