Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions integrity-jsonld/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ic7ydwk3rtoltyzx4zn3vvu3r7hpzxtmbzmnksotx7k5nbnwclf6m".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ic7ydwk3rtoltyzx4zn3vvu3r7hpzxtmbzmnksotx7k5nbnwclf6m"
"../static_contexts/cid/bafkr4ic7ydwk3rtoltyzx4zn3vvu3r7hpzxtmbzmnksotx7k5nbnwclf6m"
);
validate_json_string(json)?;
json
Expand All @@ -105,7 +105,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ibtc72t26blsnipjniwpoawtopufixoe7bbloqk7ko65cizgnhgnq".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ibtc72t26blsnipjniwpoawtopufixoe7bbloqk7ko65cizgnhgnq"
"../static_contexts/cid/bafkr4ibtc72t26blsnipjniwpoawtopufixoe7bbloqk7ko65cizgnhgnq"
);
validate_json_string(json)?;
json
Expand All @@ -115,7 +115,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ihgnzvmiaoyfeil6p56pbznofd7d4gy5qxm75rxiiy6xty6zu4up4".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ihgnzvmiaoyfeil6p56pbznofd7d4gy5qxm75rxiiy6xty6zu4up4"
"../static_contexts/cid/bafkr4ihgnzvmiaoyfeil6p56pbznofd7d4gy5qxm75rxiiy6xty6zu4up4"
);
validate_json_string(json)?;
json
Expand All @@ -126,7 +126,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ieddazlnl77lxwrygp5ky2sabfdpcowgrdr2nthd6hkhr2vcxciry".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ieddazlnl77lxwrygp5ky2sabfdpcowgrdr2nthd6hkhr2vcxciry"
"../static_contexts/cid/bafkr4ieddazlnl77lxwrygp5ky2sabfdpcowgrdr2nthd6hkhr2vcxciry"
);
validate_json_string(json)?;
json
Expand All @@ -136,7 +136,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iegfox4fmrwmjwyhnmc4rxegbzeosob5iom3tb6pejhzbekw4xk6y".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iegfox4fmrwmjwyhnmc4rxegbzeosob5iom3tb6pejhzbekw4xk6y"
"../static_contexts/cid/bafkr4iegfox4fmrwmjwyhnmc4rxegbzeosob5iom3tb6pejhzbekw4xk6y"
);
validate_json_string(json)?;
json
Expand All @@ -146,7 +146,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ib6mu2ldimhdotyqo3kocz5nhl5kbcvbhtll2lf57vmdjg6rg4tbu".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ib6mu2ldimhdotyqo3kocz5nhl5kbcvbhtll2lf57vmdjg6rg4tbu"
"../static_contexts/cid/bafkr4ib6mu2ldimhdotyqo3kocz5nhl5kbcvbhtll2lf57vmdjg6rg4tbu"
);
validate_json_string(json)?;
json
Expand All @@ -156,7 +156,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iavz5hgvy4uayvzvzle7gtsbn3u76pfhndzkvh3jefksqmltme56m".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iavz5hgvy4uayvzvzle7gtsbn3u76pfhndzkvh3jefksqmltme56m"
"../static_contexts/cid/bafkr4iavz5hgvy4uayvzvzle7gtsbn3u76pfhndzkvh3jefksqmltme56m"
);
validate_json_string(json)?;
json
Expand All @@ -166,7 +166,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iagb4u7jqlwqrftw4mn3l634wmgatmpvvzqgntgxaaerzljhggvdu".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iagb4u7jqlwqrftw4mn3l634wmgatmpvvzqgntgxaaerzljhggvdu"
"../static_contexts/cid/bafkr4iagb4u7jqlwqrftw4mn3l634wmgatmpvvzqgntgxaaerzljhggvdu"
);
validate_json_string(json)?;
json
Expand All @@ -176,7 +176,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4icpymetiq3cic3yyeolnwqcgwc56dt6mrcbl6tkoaadfvwy2dhaue".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4icpymetiq3cic3yyeolnwqcgwc56dt6mrcbl6tkoaadfvwy2dhaue"
"../static_contexts/cid/bafkr4icpymetiq3cic3yyeolnwqcgwc56dt6mrcbl6tkoaadfvwy2dhaue"
);
validate_json_string(json)?;
json
Expand All @@ -186,7 +186,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ifqh6sdsrgtos7kcukyoi4d3vsdrk3gwxuwgzs5d7pojrlzaecamy".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ifqh6sdsrgtos7kcukyoi4d3vsdrk3gwxuwgzs5d7pojrlzaecamy"
"../static_contexts/cid/bafkr4ifqh6sdsrgtos7kcukyoi4d3vsdrk3gwxuwgzs5d7pojrlzaecamy"
);
validate_json_string(json)?;
json
Expand All @@ -196,7 +196,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ib46vg45fimlp4shjfmh26t6uiny663obgmseircwt3bd2nqx34mu".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ib46vg45fimlp4shjfmh26t6uiny663obgmseircwt3bd2nqx34mu"
"../static_contexts/cid/bafkr4ib46vg45fimlp4shjfmh26t6uiny663obgmseircwt3bd2nqx34mu"
);
validate_json_string(json)?;
json
Expand All @@ -206,7 +206,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ibb27ow5o2yukccjjyrcunsk6jw4muacuk22cny7qdlw5wkfwxl2u".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ibb27ow5o2yukccjjyrcunsk6jw4muacuk22cny7qdlw5wkfwxl2u"
"../static_contexts/cid/bafkr4ibb27ow5o2yukccjjyrcunsk6jw4muacuk22cny7qdlw5wkfwxl2u"
);
validate_json_string(json)?;
json
Expand All @@ -216,7 +216,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iep2pf2ha545wx44pzkutrfp2okwk4ks6fetcje77kbegomsb3qpy".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iep2pf2ha545wx44pzkutrfp2okwk4ks6fetcje77kbegomsb3qpy"
"../static_contexts/cid/bafkr4iep2pf2ha545wx44pzkutrfp2okwk4ks6fetcje77kbegomsb3qpy"
);
validate_json_string(json)?;
json
Expand All @@ -226,7 +226,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ibcfbpprpgyqjyu2v4wddq66aeytknnlma2qd2gx3gelqhzkzc3pq".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ibcfbpprpgyqjyu2v4wddq66aeytknnlma2qd2gx3gelqhzkzc3pq"
"../static_contexts/cid/bafkr4ibcfbpprpgyqjyu2v4wddq66aeytknnlma2qd2gx3gelqhzkzc3pq"
);
validate_json_string(json)?;
json
Expand All @@ -236,7 +236,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4igip7ytxczqn27sokrcaeg7bcrny6xqpucrjthmeskmw6rj5fo63a".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4igip7ytxczqn27sokrcaeg7bcrny6xqpucrjthmeskmw6rj5fo63a"
"../static_contexts/cid/bafkr4igip7ytxczqn27sokrcaeg7bcrny6xqpucrjthmeskmw6rj5fo63a"
);
validate_json_string(json)?;
json
Expand All @@ -246,7 +246,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4icpqn6xq6ekukybpd6bq4g2whdfjw7wnhigygrngcxdi423mlwafq".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4icpqn6xq6ekukybpd6bq4g2whdfjw7wnhigygrngcxdi423mlwafq"
"../static_contexts/cid/bafkr4icpqn6xq6ekukybpd6bq4g2whdfjw7wnhigygrngcxdi423mlwafq"
);
validate_json_string(json)?;
json
Expand All @@ -256,7 +256,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4id5nmgxqdkosw4uvnrgqrqvczisyroglzxx4s7paaml3ngxlipbk4".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4id5nmgxqdkosw4uvnrgqrqvczisyroglzxx4s7paaml3ngxlipbk4"
"../static_contexts/cid/bafkr4id5nmgxqdkosw4uvnrgqrqvczisyroglzxx4s7paaml3ngxlipbk4"
);
validate_json_string(json)?;
json
Expand All @@ -266,7 +266,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iawq2vpvr64eopcgqfw3zgs3znpkmynlmyzbip7v3ip4mx2cqkxya".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iawq2vpvr64eopcgqfw3zgs3znpkmynlmyzbip7v3ip4mx2cqkxya"
"../static_contexts/cid/bafkr4iawq2vpvr64eopcgqfw3zgs3znpkmynlmyzbip7v3ip4mx2cqkxya"
);
validate_json_string(json)?;
json
Expand All @@ -276,7 +276,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4icp6axdwtsb6hcio5r2unypijfuwlp66jqci2zr2hbcvqumbxkieu".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4icp6axdwtsb6hcio5r2unypijfuwlp66jqci2zr2hbcvqumbxkieu"
"../static_contexts/cid/bafkr4icp6axdwtsb6hcio5r2unypijfuwlp66jqci2zr2hbcvqumbxkieu"
);
validate_json_string(json)?;
json
Expand All @@ -286,7 +286,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iavlckcavxdnqnn7kfwkvpxeffnclp5odzxv4sgwwiuvq3jofxwyi".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iavlckcavxdnqnn7kfwkvpxeffnclp5odzxv4sgwwiuvq3jofxwyi"
"../static_contexts/cid/bafkr4iavlckcavxdnqnn7kfwkvpxeffnclp5odzxv4sgwwiuvq3jofxwyi"
);
validate_json_string(json)?;
json
Expand All @@ -296,7 +296,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ich3kfqujikgzf6op6olv7wd6rnxfhvjbxkunccpq3d226hchjbs4".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ich3kfqujikgzf6op6olv7wd6rnxfhvjbxkunccpq3d226hchjbs4"
"../static_contexts/cid/bafkr4ich3kfqujikgzf6op6olv7wd6rnxfhvjbxkunccpq3d226hchjbs4"
);
validate_json_string(json)?;
json
Expand All @@ -306,7 +306,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4iabnkikpzzyfflv7fjphyggja6uwwi3224u24pmmzmgyfsprdex4q".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4iabnkikpzzyfflv7fjphyggja6uwwi3224u24pmmzmgyfsprdex4q"
"../static_contexts/cid/bafkr4iabnkikpzzyfflv7fjphyggja6uwwi3224u24pmmzmgyfsprdex4q"
);
validate_json_string(json)?;
json
Expand All @@ -316,7 +316,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ihfxf47x5w7geqgsmjzcu3xpkxvidwqqj4jzersgb5nk4iu7vho7a".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ihfxf47x5w7geqgsmjzcu3xpkxvidwqqj4jzersgb5nk4iu7vho7a"
"../static_contexts/cid/bafkr4ihfxf47x5w7geqgsmjzcu3xpkxvidwqqj4jzersgb5nk4iu7vho7a"
);
validate_json_string(json)?;
json
Expand All @@ -326,7 +326,7 @@ fn build_static_contexts() -> Result<ContextMap> {
"urn:cid:bafkr4ihuzdhq2mma2z7352s47nfnjntprcqfsjas4wfb72bcl3tbw5goji".to_owned(),
{
let json = include_str!(
"../../static_contexts/cid/bafkr4ihuzdhq2mma2z7352s47nfnjntprcqfsjas4wfb72bcl3tbw5goji"
"../static_contexts/cid/bafkr4ihuzdhq2mma2z7352s47nfnjntprcqfsjas4wfb72bcl3tbw5goji"
);
validate_json_string(json)?;
json
Expand All @@ -338,27 +338,27 @@ fn build_static_contexts() -> Result<ContextMap> {

let http_links: ContextMap = [
("https://www.w3.org/ns/did/v1", {
let json = include_str!("../../static_contexts/http/www.w3.org/ns/did/v1");
let json = include_str!("../static_contexts/http/www.w3.org/ns/did/v1");
validate_json_string(json)?;
json
}),
("https://www.w3.org/2018/credentials/v1", {
let json = include_str!("../../static_contexts/http/www.w3.org/2018/credentials/v1");
let json = include_str!("../static_contexts/http/www.w3.org/2018/credentials/v1");
validate_json_string(json)?;
json
}),
("https://www.w3.org/ns/credentials/v2", {
let json = include_str!("../../static_contexts/http/www.w3.org/ns/credentials/v2");
let json = include_str!("../static_contexts/http/www.w3.org/ns/credentials/v2");
validate_json_string(json)?;
json
}),
("https://w3id.org/security/v1", {
let json = include_str!("../../static_contexts/http/w3id.org/security/v1");
let json = include_str!("../static_contexts/http/w3id.org/security/v1");
validate_json_string(json)?;
json
}),
("https://w3id.org/security/v2", {
let json = include_str!("../../static_contexts/http/w3id.org/security/v2");
let json = include_str!("../static_contexts/http/w3id.org/security/v2");
validate_json_string(json)?;
json
}),
Expand Down
36 changes: 36 additions & 0 deletions integrity-jsonld/static_contexts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.PHONY: default
default: all


# To generate all static context files run:
#
# make
#
# Note: CID env vars are set by nix shell


http-urls := \
www.w3.org/2018/credentials/v1 \
www.w3.org/ns/credentials/v2 \
www.w3.org/ns/did/v1 \
w3id.org/security/v1 \
w3id.org/security/v2

dirs := http cid

http-targets := $(addprefix http/,${http-urls})
cid-targets := $(addprefix cid/,${cids})

.PHONY: all
all: ${http-targets} ig-context

${http-targets}: http/%: http
mkdir -p $(dir $@)
curl -s -L -o http/$* http://$*

${dirs}:
mkdir -p $@

.PHONY: clean
clean:
rm -rf ${dirs}
Loading