You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just used this library to sign the claims required by the App Store Connect API using JWTSigner.es256. As documented in the README, I defined a struct that conforms to Claims for my claims like so:
structConnectAPIClaims:Claims{
/// Issuer ID.
letiss:String
/// Issued At Time
letiat:UInt64
/// Expiration Time
letexp:UInt64
/// Audience
letaud:String}
Then I wanted to write a unit test where I put an expected JWT that I generated on https://jwt.io and wanted to validate that the lib is generating the same JWT with the same input data. Unfortunately, this was not possible because on each run of the test, the order of the claims JSON would change.
While I can still use the lib since the Connect API seems to work fine with changing orders, this is not optimal for ensuring that my integration of the lib works as expected. While you might already have unit tests that ensure things work within the library, I'd like to be able to write tests that ensure my integration is correct, too. So it would be awesome if there was a (simple) way to get a reproducible order for the produced JSON by my ConnectAPIClaims struct.
The text was updated successfully, but these errors were encountered:
I just used this library to sign the claims required by the App Store Connect API using
JWTSigner.es256
. As documented in the README, I defined a struct that conforms toClaims
for my claims like so:Then I wanted to write a unit test where I put an expected JWT that I generated on https://jwt.io and wanted to validate that the lib is generating the same JWT with the same input data. Unfortunately, this was not possible because on each run of the test, the order of the claims JSON would change.
While I can still use the lib since the Connect API seems to work fine with changing orders, this is not optimal for ensuring that my integration of the lib works as expected. While you might already have unit tests that ensure things work within the library, I'd like to be able to write tests that ensure my integration is correct, too. So it would be awesome if there was a (simple) way to get a reproducible order for the produced JSON by my
ConnectAPIClaims
struct.The text was updated successfully, but these errors were encountered: