flyio-go
and initialize a new project.
main.go
. Ignore the verify
function for now. We will add that
next. In the handler we will prepare all necessary variables that we need for
verification. This includes the signature and the signing keys. Then we try to
verify the request using the current signing key and if that fails we will try
the next one. If the signature could be verified, we can start processing the
request.
verify
function will handle verification of the JWT,
that includes claims about the request. See
here.
flyctl
and
then flyctl launch
the new app. This will create the necessary fly.toml
for
us. It will ask you a bunch of questions. I chose all defaults here except for
the last question. We do not want to deploy just yet.
flyctl secrets set ...
flyctl deploy
and enjoy.