attestation
attestation copied to clipboard
Feature: dynamic asn parser
Hey @weiwu-zhang
Here is an examples of how the asn1-schema library can be utilized to serialize & parse ASN using a schema provided at runtime. The schema input is currently in JSON, but we can easily bridge the gap from .asd by writing an XML converter that can output this structure. Choice functionality will also need to be added to provide full support for ASN1.
Coverage report for src/main/javascript/crypto/
β An unexpected error occurred. For more details, check console
Error: The process '/opt/hostedtoolcache/node/16.16.0/x64/bin/npm' failed with exit code 1
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π‘ | Statements | 70.95% | 1903/2682 |
π΄ | Branches | 46.53% (+1.08% πΌ) |
275/591 |
π‘ | Functions | 76.26% | 347/455 |
π‘ | Lines | 71.11% | 1861/2617 |
Show new covered files π£
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
π’ | ... / SchemaGenerator.ts |
90.91% | 70% | 100% | 92.31% |
Show files with reduced coverage π»
St.:grey_question: |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
π’ | libs/utils.ts | 87.16% | 65.28% (-1.39% π») |
94.12% | 88.44% |
Test suite run failed
Failed tests: 1/39. Failed suites: 1/2.
β read attested object βΊ validate attestation
Could not validate object
104 | me.fromBytes(bytes);
105 | if (!me.checkValidity()) {
> 106 | throw new Error("Could not validate object");
| ^
107 | }
108 | if (me.getVersion() == IdentifierAttestation.NFT_VERSION) {
109 | let x500Arr = Asn1Der.parseX500Names(me.getSubject());
at Function.fromBytes (src/libs/IdentifierAttestation.ts:106:19)
at Function.fromBytes [as fromASNType] (src/libs/SignedIdentifierAttestation.ts:33:40)
at Function.fromASNType [as fromBytes] (src/libs/SignedIdentifierAttestation.ts:25:21)
at Function.fromBytes (src/libs/AttestedObject.ts:144:46)
at Object.<anonymous> (src/main.spec.ts:668:37)
Report generated by π§ͺjest coverage report action from e4e43ec78bc62354ddf1dad6038bb274c4a992da
@micwallace what is the status on this PR? It seems to becoming stale π
@jot2re We don't really have a use case at this stage but it will be needed if we want to integrate attestations into tokenscript XML or JSON config for example.
@micwallace thanks for the update Miccy! I will keep the PR open then.