I can reproduce these issues, with the HEAD of the repo. Everything is fine with ruby2.7, but the following 8 tests fail with ruby3.0.
Failures:
1) JSON::JWS#to_json when syntax option given when general should return General JWS JSON Serialization
Failure/Error:
signed.to_json(syntax: :general).should == {
payload: Base64.urlsafe_encode64(claims.to_json, padding: false),
signatures: [{
protected: Base64.urlsafe_encode64(signed.header.to_json, padding: false),
signature: Base64.urlsafe_encode64(signed.signature, padding: false)
}]
}.to_json
expected: "{\"payload\":\"eyJpc3MiOiJqb2UiLCJleHAiOjEzMDA4MTkzODAsImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlf...GUopIoxoqe4XjoBpzE5UvhrVl5LYbdjbyJhu5ZIA8GLsgwtUFh3dfdIechORoR3k5NSFSv8157bAEa8t4iwgWD2MSNSQnw\"}]}"
got: "{\"iss\":\"joe\",\"exp\":1300819380,\"http://example.com/is_root\":true}" (using ==)
# ./spec/json/jws_spec.rb:383:in `block (5 levels) in <top (required)>'
2) JSON::JWS#to_json when syntax option given when general with blank payload should return General JWS JSON Serialization
Failure/Error:
signed_blank.to_json(syntax: :general).should == {
payload: '',
signatures: [{
protected: Base64.urlsafe_encode64(signed_blank.header.to_json, padding: false),
signature: Base64.urlsafe_encode64(signed_blank.signature, padding: false)
}]
}.to_json
expected: "{\"payload\":\"\",\"signatures\":[{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"signatur...s43GtT5bm-aJoMLct0nO1GBapQAiKUknTsw24IfOkX4vJNQzIWVSzx3zOxXjcVHlH92af6NknIlPCfRparLC9YEK2NkJYg\"}]}"
got: "{}" (using ==)
# ./spec/json/jws_spec.rb:393:in `block (6 levels) in <top (required)>'
3) JSON::JWS#to_json when syntax option given when general when not signed yet should not fail
Failure/Error:
jws.to_json(syntax: :general).should == {
payload: Base64.urlsafe_encode64(claims.to_json, padding: false),
signatures: [{
protected: Base64.urlsafe_encode64(jws.header.to_json, padding: false),
signature: Base64.urlsafe_encode64('', padding: false)
}]
}.to_json
expected: "{\"payload\":\"eyJpc3MiOiJqb2UiLCJleHAiOjEzMDA4MTkzODAsImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\",\"signatures\":[{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"signature\":\"\"}]}"
got: "{\"iss\":\"joe\",\"exp\":1300819380,\"http://example.com/is_root\":true}" (using ==)
# ./spec/json/jws_spec.rb:405:in `block (6 levels) in <top (required)>'
4) JSON::JWS#to_json when syntax option given when general when not signed yet with blank payload should not fail
Failure/Error:
jws_blank.to_json(syntax: :general).should == {
payload: '',
signatures: [{
protected: Base64.urlsafe_encode64(jws_blank.header.to_json, padding: false),
signature: Base64.urlsafe_encode64('', padding: false)
}]
}.to_json
expected: "{\"payload\":\"\",\"signatures\":[{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"signature\":\"\"}]}"
got: "{}" (using ==)
# ./spec/json/jws_spec.rb:415:in `block (7 levels) in <top (required)>'
5) JSON::JWS#to_json when syntax option given when flattened should return Flattened JWS JSON Serialization
Failure/Error:
signed.to_json(syntax: :flattened).should == {
protected: Base64.urlsafe_encode64(signed.header.to_json, padding: false),
payload: Base64.urlsafe_encode64(claims.to_json, padding: false),
signature: Base64.urlsafe_encode64(signed.signature, padding: false)
}.to_json
expected: "{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"payload\":\"eyJpc3MiOiJqb2UiLCJleHAiOjEzMD...LVGUopIoxoqe4XjoBpzE5UvhrVl5LYbdjbyJhu5ZIA8GLsgwtUFh3dfdIechORoR3k5NSFSv8157bAEa8t4iwgWD2MSNSQnw\"}"
got: "{\"iss\":\"joe\",\"exp\":1300819380,\"http://example.com/is_root\":true}" (using ==)
# ./spec/json/jws_spec.rb:429:in `block (5 levels) in <top (required)>'
6) JSON::JWS#to_json when syntax option given when flattened with blank payload should return Flattened JWS JSON Serialization
Failure/Error:
signed_blank.to_json(syntax: :flattened).should == {
protected: Base64.urlsafe_encode64(signed_blank.header.to_json, padding: false),
payload: '',
signature: Base64.urlsafe_encode64(signed_blank.signature, padding: false)
}.to_json
expected: "{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"payload\":\"\",\"signature\":\"WthQjouPVbE...Mns43GtT5bm-aJoMLct0nO1GBapQAiKUknTsw24IfOkX4vJNQzIWVSzx3zOxXjcVHlH92af6NknIlPCfRparLC9YEK2NkJYg\"}"
got: "{}" (using ==)
# ./spec/json/jws_spec.rb:437:in `block (6 levels) in <top (required)>'
7) JSON::JWS#to_json when syntax option given when flattened when not signed yet should not fail
Failure/Error:
jws.to_json(syntax: :flattened).should == {
protected: Base64.urlsafe_encode64(jws.header.to_json, padding: false),
payload: Base64.urlsafe_encode64(claims.to_json, padding: false),
signature: Base64.urlsafe_encode64('', padding: false)
}.to_json
expected: "{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"payload\":\"eyJpc3MiOiJqb2UiLCJleHAiOjEzMDA4MTkzODAsImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ\",\"signature\":\"\"}"
got: "{\"iss\":\"joe\",\"exp\":1300819380,\"http://example.com/is_root\":true}" (using ==)
# ./spec/json/jws_spec.rb:447:in `block (6 levels) in <top (required)>'
8) JSON::JWS#to_json when syntax option given when flattened when not signed yet with blank payload should not fail
Failure/Error:
jws_blank.to_json(syntax: :flattened).should == {
protected: Base64.urlsafe_encode64(jws_blank.header.to_json, padding: false),
payload: '',
signature: Base64.urlsafe_encode64('', padding: false)
}.to_json
expected: "{\"protected\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9\",\"payload\":\"\",\"signature\":\"\"}"
got: "{}" (using ==)
# ./spec/json/jws_spec.rb:455:in `block (7 levels) in <top (required)>'
Finished in 0.56325 seconds (files took 0.55478 seconds to load)
380 examples, 8 failures, 6 pending