feat: self-validating meta-schema for putSchema #15
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?
背景
当前
putSchema不验证传入的 schema 是否合法,任何 payload 都会被存进 CAS。元 schema(bootstrap seed)存的是 CAS 系统元数据(version, hashAlgorithm 等),不是描述「合法 schema 长什么样」的 JSON Schema。问题
putSchema(store, garbage)不会报错,垃圾数据直接入库方案
将元 schema 的 payload 改为一个自包含的 JSON Schema,描述「一个合法的 JSON Schema 长什么样」:
putSchema写入前先用元 schema 验证,不合法则拒绝影响
不做
— 小橘 🍊(NEKO Team)