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

Question: Approaches/Possibilities around hosting cnab-spec JSON schemas #15

Closed
vdice opened this issue Aug 8, 2019 · 8 comments · Fixed by #20
Closed

Question: Approaches/Possibilities around hosting cnab-spec JSON schemas #15

vdice opened this issue Aug 8, 2019 · 8 comments · Fixed by #20
Assignees

Comments

@vdice
Copy link
Member

vdice commented Aug 8, 2019

There is a need to host the canonical CNAB Spec JSON schema files existing in the schema directory of the deislabs/cnab-spec repository via pages under this cnab.io domain. See cnabio/cnab-spec#241, or more specifically, cnabio/cnab-spec#241 (comment).

Some of the current schemas (claim.schema.json) already include others via $ref references. When third-party/remote schema validation is attempted (say, CNAB tools that wish to verify their Claim object aligns with the claims schema), the validation will need to fetch any/all $ref references. The references (which match schema $ids) currently take the form of http://cnab.io/v1/claims.schema.json, http://cnab.io/v1/bundle.schema.json, etc.

Therefore, I'm wondering what approaches we have to hosting these files from this repo/on the cnab.io website? Can hugo fetch and host files from a remote repository? Do we need to add a pre-build step to curl or otherwise fetch these files instead? Or, should the files be hosted from the cnab-spec repo itself, say, via a GH Pages mechanism, but with some sort of alias/redirection such that the aforementioned URIs result?

cc @flynnduism for advice/brainstorming

@carolynvs
Copy link
Collaborator

One way to do it would be to add cnab-spec as a git submodule which Netlify supports. Then it will show up as a subdirectory and we can pull those files in and publish them as static assets using Hugo like we normally do.

@flynnduism flynnduism self-assigned this Aug 14, 2019
@flynnduism
Copy link
Collaborator

I like @carolynvs suggestion - if we can do this with submodules that would be great. I've previously used things like Gulp to import files from other repos into a Hugo site during the build process with Netlify. Not the cleanest approach though.

Spec Updates

Would a .git submodule auto-update when changes are made to the cnab-spec repo? Or would we want to configure some way of rebuilding cnab.io each time there's a spec update?

JSON Web View

@vdice does this proposal mean serving the json schema in a webpage on cnab.io? I.e. wrapping it in some sort of UI - or simply hosting the file as is?

@carolynvs
Copy link
Collaborator

I think we can add a webhook for our cnab.io build to the cnab-spec repo. So when the cnab-spec repo gets new commits on master, it will trigger the webhook for a netlify build of the cnab.io website.

https://www.netlify.com/docs/webhooks/

@carolynvs
Copy link
Collaborator

We absolutely need to host the schema json files as-is. So that people can download the spec automatically and use it to validate their bundles against them.

If we decide to have human readable representations of the spec later on, that's up to us. 😀

@vdice
Copy link
Member Author

vdice commented Aug 19, 2019

We absolutely need to host the schema json files as-is.

Yup, ditto ^^. Thanks, @flynnduism !

@MartinForReal
Copy link

I'm wondering if we could reuse spiffe.io as identitfication framework because it provide end to end validation process.

@technosophos
Copy link
Member

For now, can we create redirects that send requests to https://raw.githubusercontent.com/cnabio/cnab-spec/cnab-core-1.0/schema/definitions.schema.json and similar?

@vdice
Copy link
Member Author

vdice commented Feb 13, 2020

@technosophos good idea; I'll take a look at our config and see if this is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants