Skip to content

Instantly share code, notes, and snippets.

@shrmpy
Created November 3, 2021 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrmpy/4017db7f99d1cb9d35f01f68bfed39a9 to your computer and use it in GitHub Desktop.
Save shrmpy/4017db7f99d1cb9d35f01f68bfed39a9 to your computer and use it in GitHub Desktop.
Add claims-extraction because it verifies the extension secret
// extension secret is enforced by claims extraction
cl, err := helper.claims(token)
if err != nil {
log.Print("Malformed claims meta data")
return newResponse("Wrong authorization header", http.StatusUnauthorized),
errors.New("claims")
}
log.Printf("Claims (ch/role): %s / %s", cl.ChannelID, cl.Role)
return events.APIGatewayProxyResponse{}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment