1EdTech / openbadges-discussion

A no-code repository for having discussions related to the general technical issues of openbadges.
10 stars 3 forks source link

A method to use a checksum to make sure schema reference hasn't changed #13

Open ottonomy opened 10 years ago

ottonomy commented 10 years ago

Here is another variation on the extension idea that uses a SHA-1 hash of the schema json file to verify that the schema referenced in the badgeClass extension is indeed the version intended. This protects against bad versioning practices on behalf of schema authors (overwriting previous versions). The checksum is listed as optional in the badgeClass schema.

For a system that scrapes and stores many extension schema, including a standardized hash could allow these schema to be stored in a hash table. This would allow them to avoid making unnecessary requests for previously encountered schema while ensuring that they would still know when the version changes. New versions of schema would have different hashes and would not overwrite previous versions in a hash table based cache.

Referenced in mozilla/openbadges-discussion/#11 by @kayaelle

ottonomy commented 10 years ago

@andrewhayward: Thanks for all the JSON-schema suggestions. @kayaelle told me there were some ways to do URI/email/regex type data-validation, but I hadn't been able to dig into them yet. I'll make a few changes and make another commit tomorrow.