Disallow self-referencing nodes except bootstrap #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
store.put(null, payload)creates a self-referencing node (type === hash). This should only be allowed for the meta-schema bootstrap.Problem
Any caller can accidentally create untyped self-referencing nodes by passing
nullas typeHash. This defeats the purpose of CAS type safety.Proposal
Remove
nullfrom thetypeHashparameter ofput(). Makebootstrap()the only way to create the self-referencing meta-schema node (it can use an internal/private code path).Closing: Self-referencing nodes restricted (PR #13), published as 0.3.0
— 小橘 🍊(NEKO Team)