magic-admin-go icon indicating copy to clipboard operation
magic-admin-go copied to clipboard

Add tooling to generate DID tokens for testing

Open ryanc414 opened this issue 2 years ago • 0 comments

I recently started using the Magic Go SDK for the backend portion of our integration with Magic. We want to be able to test the code we have written and deployed, so it's useful to be able to generate DID tokens.

I went ahead and implemented the pseudo-code recipe for generating DID tokens (https://magic.link/docs/introduction/decentralized-id#generating-a-did-token-pseudo-code) in Go, I was wondering if this would be a useful addition to this SDK repo? I'm happy to make a PR if so!

So far I'm generating ephemeral keypairs for each test run, so naturally the magic API will not recognise these users. However, since our backend is just using the token.NewToken() constructor to validate and extract the Issuer, it doesn't matter whether the user is actually registered on the Magic side or not (we will check if we recognise the Issuer our side).

I'm also curious if you have any other thouhts to share regarding testing and if there's anything I might have missed?

ryanc414 avatar Apr 13 '22 16:04 ryanc414