spruceid / didkit

A cross-platform toolkit for decentralized identity.
https://www.spruceid.dev/didkit/didkit
Apache License 2.0
266 stars 76 forks source link

Missing key when issuing credential for didkit-http #358

Closed shihjay2 closed 1 year ago

shihjay2 commented 1 year ago

Since updating to 20230517081123998f295 using Docker, calls to /credentials/issue result in a 'Missing key' error. I have set previously the JWK in an .env file that is passed to the Docker container and had no errors prior to the update. I also tried updating the command: argument in docker-compose with "-j $JWK" and it still results in the error. I have confirmed that the JWK environmental variable value is able to be printed when accessing the container's shell and is valid. Has there been a change in how the JWK is to be declared in the didkit-http command?

sbihel commented 1 year ago

Yes indeed there was a complete refactor with breaking changes to the configuration and I forgot to update the README. Apologies.

Do say if the README is not clear enough

shihjay2 commented 1 year ago

@sbihel , this points me in the right direction. However, with my testing, using the environmental variables, if declared the env file in a docker compose.yml file, I'm still getting a missing key error. I used the DIDKIT_ISSUER_KEYS='... both as a JSON string and an array of JSON strings in the .env file.

shihjay2 commented 1 year ago

After reviewing your code, I'm suspecting that these overrides can only be set prior to docker build and cannot be applied to the provided docker image referenced in the README. Is that correct and if so, is there any plan to add the ability to apply configs to the docker image as part of my project involves generating the JWK in a bash script using didkit-cli and then saving the JWK in an .env file referenced in a docker-compose file for the didkit-http image to use? This was working previously prior to the refactoring.

sbihel commented 1 year ago

I made a typo, the prefix for env vars is DIDKIT_HTTP_. And the overrides are read at startup time, so it should work for you now

shihjay2 commented 1 year ago

Thank you, it is now working as expected.