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

Simplify the <issuer>/raw/jwt/sign example #386

Open
alegomes opened this issue May 10, 2024 · 0 comments
Open

Simplify the <issuer>/raw/jwt/sign example #386

alegomes opened this issue May 10, 2024 · 0 comments

Comments

@alegomes
Copy link
Contributor

The endpoint /raw/jwt/sign requires 2 parameters walt-key and walt-subjectDid

If passed incorrectly, the endpoint returns unexplained messages, such as:

{"exception":"true","status":"Bad Request","code":"400","message":"Expected class kotlinx.serialization.json.JsonObject as the serialized body of kotlinx.serialization.Polymorphic<Key>, but had class kotlinx.serialization.json.JsonLiteral"}

If we were follow our intuition, we would use the /wallet-api/wallet/{wallet}/keys/generate and /wallet-api/wallet/{wallet}/dids/create/key endpoints to get the missing data.

However, two things make life difficult for the developer here:

  1. The key generation endpoint, for example, returns in such a format that is not accepted out of the box by the walt-key parameter.

  2. If the user manage to generate the key in the expected JWK format (e.g. XXXXXX), he tends to use the key in its raw form in the walt-key field instead of wrapping it as {"type":"local","jwk":"XXXX"}

How can we make this endpoint testing experience more intuitive and less laborious?

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

1 participant