-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature: dynamic asn parser #289
base: main
Are you sure you want to change the base?
Conversation
- Cleanup HTML test, move out of main class file. - Improve verbosity of API & private members. - Add hex & base64 format support.
Coverage report for
|
St.❔ |
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.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🟢 | ... / SchemaGenerator.ts |
90.91% | 70% | 100% | 92.31% |
Show files with reduced coverage 🔻
St.❔ |
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 e4e43ec
@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. |
d7bd286
to
e4e43ec
Compare
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.