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

BaseFrame causes issues when the type is Record<string, unknown> #13

Open
TimoGlastra opened this issue Jan 8, 2024 · 2 comments
Open

Comments

@TimoGlastra
Copy link
Contributor

When you use the default type Record<string, unknown> this causes issues for nested frames.

So let's say I dezerialize an SD-JWT ey123.ey123.ey123~123~456~ into a sd-jwt the types for Header and Payload will be Record<string, unknown>.

If I now want to do create a presentation frame (or disclosure frame, they're based on the same base frame) it will result in errors If I use a nested object:

{
   // errors as 'nested' key is expected to have boolean | undefined value
   nested: {
    claim: true
  }
}

I think when we don't know the value of something (= unknown) we should not say the value should be boolean, but rather it can be an array with booleans an objects with new key values or a boolean, as we don't know the structure of the object

@TimoGlastra TimoGlastra moved this to Todo in EUDI/ARF Jan 8, 2024
@berendsliedrecht
Copy link
Owner

I think that makes sense, yeah. When I designed the API I think I had the issuer mainly in my mind, which does not encounter this issue as the type of the payload is always complete. But from the holder or verifier, some of the values might be in the disclosure array.

@TimoGlastra
Copy link
Contributor Author

I had the issuer mainly in my mind, which does not encounter this issue as the type of the payload is always complete

Not necessarily if the payload is passed dynamically (think over rest api).

@TimoGlastra TimoGlastra moved this from Todo to Backlog in EUDI/ARF Jan 25, 2024
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

No branches or pull requests

2 participants