rust-jwt
rust-jwt copied to clipboard
Allow custom value in `HeaderContentType`
Generating JWTs for client API access to Twilio requires setting the cty field of the JWT header to a specific magic string: https://www.twilio.com/docs/iam/access-tokens#jwt-format
ctyis the content-type and encodes the version of the Access Token. Its value must be"twilio-fpa;v=1".
It would be nice not to have to implement JoseHeader for a custom type just to set this. I'm thinking an extra variant HeaderContentType::Custom(String) would be sufficient. If we want to ensure it's a properly formatted MIME type it could be mime::Mime instead but I feel like that's overkill.