-
Notifications
You must be signed in to change notification settings - Fork 3
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
A method to use a checksum to make sure schema reference hasn't changed #13
Open
ottonomy
wants to merge
10
commits into
1EdTech:master
Choose a base branch
from
ottonomy:schema-hash
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0138641
defines badgeClass in JSON-schema, a sample extension for age target,…
ottonomy 25ff730
updated description to be get rid of inaccurate text I had copied in
ottonomy e1d3388
2 spaces for tabs, renames extension object based on suggestions
ottonomy 04019e7
adds checksum object with alg,hash properties to the badgeClass schem…
ottonomy 7616aca
switched to a single field method for adding a checksum, string like alg
ottonomy d0dede7
removed title and version properties from extension schema object
ottonomy feefc0a
adds format:uri to badgeclass where needed
ottonomy f6d2abe
deletes errant comma making json invalid
ottonomy 61eeba7
adds regex pattern for checksum to match, w/ escaped backslashes
ottonomy 02f5572
corrects regex pattern for checksum to match, w/ escaped backslashes
ottonomy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "Sample Extended Badge", | ||
"description": "For doing awesome things in fairly standard ways.", | ||
"image": "https://example.org/extended-badge-longcat.png", | ||
"criteria": "https://example.org/extended-badge.html", | ||
"tags": ["badgeClassExtensions"], | ||
"issuer": "https://example.org/organization.json", | ||
"extensions": [ | ||
{ | ||
"schema": { | ||
"reference": "http://this-domain.org/schema-age-target-v0.5.json", | ||
"checksum": "sha1$596d1c1c7ab83eed4f62f445fe2489086c6e3d36" | ||
}, | ||
"content": { | ||
"age": "5-18", | ||
"grade": "K-12" | ||
} | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title" : "Badge Age Target", | ||
"description": "A suggested age or US grade range targeted by the described badge or learning experience. Use one or both options.", | ||
"type": "object", | ||
"properties": { | ||
"age": { | ||
"description": "The targeted age range for a badge or learning experience (e.g. '6-10')", | ||
"type": "string" | ||
}, | ||
"grade": { | ||
"description": "The targeted US grade range for a badge or learning experience (e.g. 'K-3')", | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"title" : "Open Badge BadgeClass Definition v1.1", | ||
"description": "A schematic defining how an issuer defines an open badge to issue to its users", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "A name or title of the particular badge defined in the present badge class, which could then be issued to many recipients.", | ||
"type": "string" | ||
}, | ||
"description": { | ||
"description": "A short description of the achievement represented by the present badge.", | ||
"type": "string" | ||
}, | ||
"image": { | ||
"description": "The URL of the image that represents the present achievement. It will be baked into a complete badge for each recipient.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"criteria": { | ||
"description": "The URL of a human-readable page describing the criteria for earning the achievement. If the badge represents an educational achievement, consider marking up this up with LRMI.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"issuer": { | ||
"description": "URL of an object describing the organization that issued the badge. Endpoint should be JSON following the IssuerOrganization schema", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"tags": { | ||
"description": "An array of text: List of tags that describe the type of achievement.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"alignment": { | ||
"description": "List of objects describing which educational standards this badge aligns to, if any. An array of AlignmentObjects.", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "Name of the alignment.", | ||
"type": "string" | ||
}, | ||
"url": { | ||
"description": "URL linking to the official description of the standard.", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"description": { | ||
"description": "Short description of the standard.", | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["name","url"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"extensions": { | ||
"description": "An array of objects each linking to and fulfilling a schema for additional badge class information", | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"reference": { | ||
"description": "URL to the JSON-schema file defining the structure of this extension", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"checksum": { | ||
"description": "SHA-1 hash of the linked schema file so issuers may avoid downloading it repeatedly. use format: alg$hash", | ||
"type": "string", | ||
"pattern": "^\\w+\\$\\w+$" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find many examples of this, but it looks like backslashes in JSON need to be escaped, and schema validators are equipped to handle it like this. Tested, success on http://json-schema-validator.herokuapp.com/index.jsp |
||
} | ||
}, | ||
"required": ["reference"] | ||
}, | ||
"content": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": ["schema", "content"] | ||
} | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also want to include
"pattern": "^\w+\$\w+$"
(or similar) here.