-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: idvc on v4 #6
Conversation
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
test/fixtures/v4/tt/did-idvc-wrapped-signed-wrong-binding.json|131 col 2| Insert ⏎
test/fixtures/v4/tt/did-idvc-wrapped-signed.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-idvc-wrapped-signed.json|28 col 20| Replace ⏎············"VerifiableCredential"⏎··········
with "VerifiableCredential"
test/fixtures/v4/tt/did-idvc-wrapped-signed.json|35 col 22| Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
test/fixtures/v4/tt/did-idvc-wrapped-signed.json|131 col 2| Insert ⏎
test/fixtures/v4/tt/did-idvc-wrapped-tampered-signature.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-idvc-wrapped-tampered-signature.json|28 col 20| Replace ⏎············"VerifiableCredential"⏎··········
with "VerifiableCredential"
test/fixtures/v4/tt/did-idvc-wrapped-tampered-signature.json|35 col 22| Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
test/fixtures/v4/tt/did-idvc-wrapped-tampered-signature.json|129 col 2| Insert ⏎
test/fixtures/v4/tt/did-idvc-wrapped-wrong-binding.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-idvc-wrapped-wrong-binding.json|28 col 20| Replace ⏎············"VerifiableCredential"⏎··········
with "VerifiableCredential"
test/fixtures/v4/tt/did-idvc-wrapped-wrong-binding.json|35 col 22| Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
test/fixtures/v4/tt/did-idvc-wrapped-wrong-binding.json|129 col 2| Insert ⏎
test/fixtures/v4/tt/did-idvc-wrapped.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-idvc-wrapped.json|28 col 20| Replace ⏎············"VerifiableCredential"⏎··········
with "VerifiableCredential"
test/fixtures/v4/tt/did-idvc-wrapped.json|35 col 22| Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
test/fixtures/v4/tt/did-idvc-wrapped.json|129 col 2| Insert ⏎
test/fixtures/v4/tt/did-wrapped-obfuscated.json|2 col 16| Replace "https://www.w3.org/2018/credentials/v1",·"https://schemata.openattestation.com/io/tradetrust/4.0/alpha-context.json"
with ⏎····"https://www.w3.org/2018/credentials/v1",⏎····"https://schemata.openattestation.com/io/tradetrust/4.0/alpha-context.json"⏎··
test/fixtures/v4/tt/did-wrapped-signed.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-wrapped-signed.json|92 col 2| Insert ⏎
test/fixtures/v4/tt/did-wrapped-signed2.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-wrapped-signed2.json|92 col 2| Insert ⏎
test/fixtures/v4/tt/did-wrapped.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-wrapped.json|90 col 2| Insert ⏎
test/fixtures/v4/tt/did-wrapped2.json|6 col 12| Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
test/fixtures/v4/tt/did-wrapped2.json|90 col 2| Insert ⏎
scripts/generate.ts
Outdated
keys?: [string, string]; | ||
} | ||
const run = async ({ location, keys }: IRun) => { | ||
let resolved = path.resolve(location); |
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.
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'resolved' is never reassigned. Use 'const' instead.
let resolved = path.resolve(location); | |
const resolved = path.resolve(location); |
scripts/generate.ts
Outdated
} | ||
const run = async ({ location, keys }: IRun) => { | ||
let resolved = path.resolve(location); | ||
let name = path.basename(resolved); |
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.
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'name' is never reassigned. Use 'const' instead.
let name = path.basename(resolved); | |
const name = path.basename(resolved); |
scripts/generate.ts
Outdated
const run = async ({ location, keys }: IRun) => { | ||
let resolved = path.resolve(location); | ||
let name = path.basename(resolved); | ||
let dirName = path.dirname(resolved); |
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.
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'dirName' is never reassigned. Use 'const' instead.
let dirName = path.dirname(resolved); | |
const dirName = path.dirname(resolved); |
scripts/generate.ts
Outdated
let resolved = path.resolve(location); | ||
let name = path.basename(resolved); | ||
let dirName = path.dirname(resolved); | ||
let document = readFile(resolved); |
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.
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'document' is never reassigned. Use 'const' instead.
let document = readFile(resolved); | |
const document = readFile(resolved); |
scripts/generate.ts
Outdated
let dirName = path.dirname(resolved); | ||
let document = readFile(resolved); | ||
if (utils.isRawOAV4Document(document)) { | ||
let wrapName = name.replace("raw", "wrapped"); |
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.
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'wrapName' is never reassigned. Use 'const' instead.
let wrapName = name.replace("raw", "wrapped"); | |
const wrapName = name.replace("raw", "wrapped"); |
"type": [ | ||
"CorporateBasicDetails" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
"type": [ | |
"CorporateBasicDetails" | |
], | |
"type": ["CorporateBasicDetails"], |
"key": "did:ethr:0xE94E4f16ad40ADc90C29Dc85b42F1213E034947C#controller", | ||
"signature": "0x725dc1af3ec48a3b1a279c6b09e96a69d92c9f20f1570c3a00984bce20240d591782ab1b36de4fb57f445811c3e41805f1663bcbddfa842e00b85370127f9b1d1b" | ||
} | ||
} |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ⏎
} | |
} | |
"type": [ | ||
"VerifiableCredential", | ||
"TradeTrustCredential" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
"type": [ | |
"VerifiableCredential", | |
"TradeTrustCredential" | |
], | |
"type": ["VerifiableCredential", "TradeTrustCredential"], |
"type": [ | ||
"VerifiableCredential" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎············"VerifiableCredential"⏎··········
with "VerifiableCredential"
"type": [ | |
"VerifiableCredential" | |
], | |
"type": ["VerifiableCredential"], |
"type": [ | ||
"CorporateBasicDetails" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎··············"CorporateBasicDetails"⏎············
with "CorporateBasicDetails"
"type": [ | |
"CorporateBasicDetails" | |
], | |
"type": ["CorporateBasicDetails"], |
f5636f6
to
2728d55
Compare
"type": [ | ||
"VerifiableCredential", | ||
"TradeTrustCredential" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
"type": [ | |
"VerifiableCredential", | |
"TradeTrustCredential" | |
], | |
"type": ["VerifiableCredential", "TradeTrustCredential"], |
"obfuscated": [] | ||
} | ||
} | ||
} |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ⏎
} | |
} | |
"type": [ | ||
"VerifiableCredential", | ||
"TradeTrustCredential" | ||
], |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace ⏎····"VerifiableCredential",⏎····"TradeTrustCredential"⏎··
with "VerifiableCredential",·"TradeTrustCredential"
"type": [ | |
"VerifiableCredential", | |
"TradeTrustCredential" | |
], | |
"type": ["VerifiableCredential", "TradeTrustCredential"], |
"key": "did:ethr:0xE94E4f16ad40ADc90C29Dc85b42F1213E034947C#controller", | ||
"signature": "0x3d75668bff0071088858d7aee535bf2df0c2536ada0690823b941dfa3c64ca6001c495aa53b1cedd870f5712e075fa558e22c42b0aa61b3141ab9ec3a327c6821c" | ||
} | ||
} |
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.
🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Insert ⏎
} | |
} | |
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 6.8.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* chore: ds store * feat: init release * chore: commit lock * feat: idvc feature * feat: idvc feature * chore: fix lint errors * feat: regenerate test fixtures for ttv4 * fix: lint errors * chore: update readme * chore: fix lint errors * feat: add additional fixtures for invalid idvc case * feat: add fixtures for error case when idvc is missing * fix: lint errors
* feat: init release (#4) * feat: trigger tagged build (#8) * feat: oa v4 (alpha) (Open-Attestation#254) * ci: prepare alpha release * feat: oa v4 alpha * fix: lint errors * test: update fixtures * chore: update id description * test: update fixtures * chore: improve readability * fix: pr review suggestions * fix: stricter checks for isStringArray * fix: getDocumentData for v4 * chore: update getTemplateURL error message * feat: idvc on v4 (#6) * chore: ds store * feat: init release * chore: commit lock * feat: idvc feature * feat: idvc feature * chore: fix lint errors * feat: regenerate test fixtures for ttv4 * fix: lint errors * chore: update readme * chore: fix lint errors * feat: add additional fixtures for invalid idvc case * feat: add fixtures for error case when idvc is missing * fix: lint errors * feat: tagged release, update badge for github actions * feat: trigger release after rebase of alpha --------- Co-authored-by: Kyle Huang Junyuan <kyle@hjunyuan.com>
Summary
What is the background of this pull request?
This PR introduces a new tradetrust document type that differs from the current oa-v4-alpha document.
look at: Open-Attestation/schemata#81 for the differences in schema and contexts.
As a new document type is introduced, the relevant type guards/salt/sign/wrap functionalities are all duplicated.
On top of that, it renames all current v4 references to prefix it with OA since there is a request for backwards compatibility for this particular fork.
For certain guards, additional code has been added to ensure that a verifier would not mistake a raw v4 oa document with a raw v4 tt document.
For this fork, we would not generate existing v2 and v3 schemas as we would be reusing the hosted ones.
For context preloading, we are resolving the w3c based ones to the locally saved copy, why? for the past few weeks, the w3c contexts have been giving intermittent responses or giving throttled responses, so this is a stop gap measure to ensure that the functionality works. (I am open to change it at a later time).
quicktype: 15.0.260 -> 23.076
For the generation of types via quicktype, have discovered that the version of quicktype we are currently on does not respect JSON schema's
additionalProperties
glideapps/quicktype#1615Do tell me if its too gigantic, and I would try to split the PR into something like that:
Issues
What are the related issues or stories?
story card: https://www.pivotaltracker.com/story/show/186245911
Other stuff to do:
1. Currently most of the Tradetrust documents fixtures are utilisinglocalhost:8080
which points to a dev server where I am serving the contexts, once Open-Attestation/schemata#81 gets merged, I would need to replace those fixtures.