Diff of the two buildlogs: -- --- b1/build.log 2023-04-10 14:10:20.548911720 +0000 +++ b2/build.log 2023-04-10 14:12:38.056326291 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sun May 12 08:31:16 -12 2024 -I: pbuilder-time-stamp: 1715545876 +I: Current time: Tue Apr 11 04:10:24 +14 2023 +I: pbuilder-time-stamp: 1681135824 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/bookworm-reproducible-base.tgz] I: copying local configuration @@ -16,7 +16,7 @@ I: copying [./ruby-jwt_2.5.0.orig.tar.gz] I: copying [./ruby-jwt_2.5.0-1.debian.tar.xz] I: Extracting source -gpgv: Signature made Wed Nov 30 16:05:35 2022 -12 +gpgv: Signature made Thu Dec 1 18:05:35 2022 +14 gpgv: using EDDSA key 84CFFDC21520F88306EC29D152699AB63F9F2BC3 gpgv: Can't check signature: No public key dpkg-source: warning: cannot verify inline signature for ./ruby-jwt_2.5.0-1.dsc: no acceptable signature found @@ -27,11 +27,20 @@ dpkg-source: info: applying no-pending-tests.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/14869/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/D01_modify_environment starting +debug: Running on codethink16-arm64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +lrwxrwxrwx 1 root root 4 Jan 6 03:20 /bin/sh -> dash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/D02_print_environment starting I: set BUILDDIR='/build' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME='pbuilder2' BUILD_ARCH='arm64' DEBIAN_FRONTEND='noninteractive' DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=8' @@ -41,38 +50,38 @@ IFS=' ' LANG='C' - LANGUAGE='en_US:en' + LANGUAGE='nl_BE:nl' LC_ALL='C' MAIL='/var/mail/root' OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' + PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path' PBCURRENTCOMMANDLINEOPERATION='build' PBUILDER_OPERATION='build' PBUILDER_PKGDATADIR='/usr/share/pbuilder' PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' PBUILDER_SYSCONFDIR='/etc' - PPID='14869' + PPID='5945' PS1='# ' PS2='> ' PS4='+ ' PWD='/' SHELL='/bin/bash' SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.Y4xEuz9H/pbuilderrc_Fyko --distribution bookworm --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.Y4xEuz9H/b1 --logfile b1/build.log ruby-jwt_2.5.0-1.dsc' + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.Y4xEuz9H/pbuilderrc_IfPw --distribution bookworm --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/bookworm-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.Y4xEuz9H/b2 --logfile b2/build.log --extrapackages usrmerge ruby-jwt_2.5.0-1.dsc' SUDO_GID='117' SUDO_UID='110' SUDO_USER='jenkins' TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' + TZ='/usr/share/zoneinfo/Etc/GMT-14' USER='root' USERNAME='root' _='/usr/bin/systemd-run' http_proxy='http://192.168.101.16:3128' I: uname -a - Linux codethink13-arm64 4.15.0-208-generic #220-Ubuntu SMP Mon Mar 20 14:28:12 UTC 2023 aarch64 GNU/Linux + Linux i-capture-the-hostname 4.15.0-208-generic #220-Ubuntu SMP Mon Mar 20 14:28:12 UTC 2023 aarch64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 May 10 04:48 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/14869/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Apr 9 00:25 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -260,7 +269,7 @@ Get: 140 http://deb.debian.org/debian bookworm/main arm64 ruby-rspec all 3.12.0c0e1m1s0-1 [5084 B] Get: 141 http://deb.debian.org/debian bookworm/main arm64 ruby-simplecov-html all 0.12.3-2 [468 kB] Get: 142 http://deb.debian.org/debian bookworm/main arm64 ruby-simplecov all 0.22.0-1 [45.1 kB] -Fetched 47.0 MB in 1s (36.2 MB/s) +Fetched 47.0 MB in 1s (34.2 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:arm64. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19616 files and directories currently installed.) @@ -851,8 +860,17 @@ Writing extended state information... Building tag database... -> Finished parsing the build-deps +Reading package lists... +Building dependency tree... +Reading state information... +usrmerge is already the newest version (35). +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. I: Building the package -I: Running cd /build/ruby-jwt-2.5.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-jwt_2.5.0-1_source.changes +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/A99_set_merged_usr starting +Re-configuring usrmerge... +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/A99_set_merged_usr finished +hostname: Temporary failure in name resolution +I: Running cd /build/ruby-jwt-2.5.0/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-jwt_2.5.0-1_source.changes dpkg-buildpackage: info: source package ruby-jwt dpkg-buildpackage: info: source version 2.5.0-1 dpkg-buildpackage: info: source distribution unstable @@ -881,7 +899,7 @@ dh_prep -O--buildsystem=ruby dh_auto_install --destdir=debian/ruby-jwt/ -O--buildsystem=ruby dh_ruby --install /build/ruby-jwt-2.5.0/debian/ruby-jwt -/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20240512-21914-r72p9u/gemspec +/usr/bin/ruby3.1 -S gem build --config-file /dev/null --verbose /tmp/d20230411-13031-2be936/gemspec Failed to load /dev/null because it doesn't contain valid YAML hash WARNING: open-ended dependency on appraisal (>= 0, development) is not recommended use a bounded requirement, such as '~> x.y' @@ -900,7 +918,7 @@ Name: jwt Version: 2.5.0 File: jwt-2.5.0.gem -/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-jwt/usr/share/rubygems-integration/all /tmp/d20240512-21914-r72p9u/jwt-2.5.0.gem +/usr/bin/ruby3.1 -S gem install --config-file /dev/null --verbose --local --verbose --no-document --ignore-dependencies --install-dir debian/ruby-jwt/usr/share/rubygems-integration/all /tmp/d20230411-13031-2be936/jwt-2.5.0.gem Failed to load /dev/null because it doesn't contain valid YAML hash /build/ruby-jwt-2.5.0/debian/ruby-jwt/usr/share/rubygems-integration/all/gems/jwt-2.5.0/lib/jwt.rb /build/ruby-jwt-2.5.0/debian/ruby-jwt/usr/share/rubygems-integration/all/gems/jwt-2.5.0/lib/jwt/algos.rb @@ -968,473 +986,213 @@ All examples were filtered out; ignoring {:focus=>true} -Randomized with seed 984 - -JWT::JWK::Thumbprint - #to_s - when EC key is given - is expected to eq "dO52_we59sdR49HsGCpVzlDUQNvT3KxCTGakk4Un8qc" - when HMAC key is given - is expected to eq "wPf4ZF5qlzoFxsGkft4eu1iWcehgAcahZL4XPV4dT-s" - when example from RFC is given - is expected to eq "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs" - -JWT::ClaimsValidator - #validate! - iat claim - it should behave like a NumericDate claim - when iat payload is a float - does not raise error - when iat payload is a string - raises error - and key is a string - raises error - when iat payload is an integer - does not raise error - and key is a string - does not raise error - when iat payload is a Time object - raises error - when iat payload is a string - raises error - nbf claim - it should behave like a NumericDate claim - when nbf payload is a Time object - raises error - when nbf payload is a float - does not raise error - when nbf payload is an integer - does not raise error - and key is a string - does not raise error - when nbf payload is a string - raises error - when nbf payload is a string - raises error - and key is a string - raises error - exp claim - it should behave like a NumericDate claim - when exp payload is a Time object - raises error - when exp payload is a string - raises error - and key is a string - raises error - when exp payload is a string - raises error - when exp payload is a float - does not raise error - when exp payload is an integer - does not raise error - and key is a string - does not raise error - -JWT::Verify - .verify_sub(payload, options) - must raise JWT::InvalidSubError when the subjects do not match - must allow a matching sub - .verify_required_claims(payload, options) - must verify the claims if all required claims are present - must raise JWT::MissingRequiredClaim if a required claim is absent - .verify_iss(payload, options) - when iss is an Array - must raise JWT::InvalidIssuerError when the payload does not include an issuer - must allow an array with matching issuer to pass - must raise JWT::InvalidIssuerError when no matching issuers in array - when iss is a RegExp - must raise JWT::InvalidIssuerError when the payload does not include an issuer - must allow a regular expression matching the issuer to pass - must raise JWT::InvalidIssuerError when the regular expression does not match - when iss is a String - must allow a matching issuer to pass - must raise JWT::InvalidIssuerError when the payload does not include an issuer - must raise JWT::InvalidIssuerError when the configured issuer does not match the payload issuer - when iss is a Proc - must raise JWT::InvalidIssuerError when the payload does not include an issuer - must allow a proc that returns true to pass - must raise JWT::InvalidIssuerError when the proc returns false - when iss is a Method instance - must allow a method that returns true to pass - must raise JWT::InvalidIssuerError when the method returns false - must raise JWT::InvalidIssuerError when the payload does not include an issuer - .verify_jti(payload, options) - must raise JWT::InvalidJtiError when verify_jti proc returns false - should have payload as second param in proc - must allow any jti when the verfy_jti key in the options is truthy but not a proc - must raise JWT::InvalidJtiError when the jti is missing - it should not throw arguement error with 2 args - must raise JWT::InvalidJtiError when the jti is an empty string - true proc should not raise JWT::InvalidJtiError - .verify_aud(payload, options) - must raise JWT::InvalidAudError when the payload has an array and none match the supplied value - must allow an array with any value matching the one in the options - must raise JWT::InvalidAudError when the singular audience does not match - must allow an array with any value matching any value in the options array - must allow a matching singular audience to pass - must allow a singular audience payload matching any value in the options array - .verify_claims - must raise error when verify_sub option is set to true - must raise error when verify_iss option is set to true - must raise error when verify_expiration option is set to true - must raise error when verify_iat option is set to true - must skip verification when verify_aud option is set to false - must skip verification when verify_sub option is set to false - must skip verification when verify_iss option is set to false - must raise error when verify_jti option is set to true - must raise error when verify_aud option is set to true - must raise error when verify_not_before option is set to true - must skip verification when verify_iat option is set to false - must skip verification when verify_jti option is set to false - must skip verification when verify_expiration option is set to false - must skip verification when verify_not_before option is set to false - .verify_iat(payload, options) - must raise JWT::InvalidIatError when the iat value is not Numeric - must ignore configured leeway - must properly handle integer times - must allow a valid iat - must raise JWT::InvalidIatError when the iat value is in the future - .verify_not_before(payload, options) - must raise JWT::ImmatureSignature when the nbf in the payload is in the future - must allow some leeway in the token age when global leeway is configured - must allow some leeway in the token age when nbf_leeway is configured - .verify_expiration(payload, options) - must allow some leeway in the expiration when global leeway is configured - must allow some leeway in the expiration when exp_leeway is configured - must raise JWT::ExpiredSignature when the token has expired - must be expired if the exp claim equals the current time - when leeway is not specified - used a default leeway of 0 - -JWT::Algos::Ecdsa - .curve_by_name - when secp256r1 is given - is expected to eq {:algorithm=>"ES256", :digest=>"sha256"} - when secp256k1 is given - is expected to eq {:algorithm=>"ES256K", :digest=>"sha256"} - when secp521r1 is given - is expected to eq {:algorithm=>"ES512", :digest=>"sha512"} - when prime256v1 is given - is expected to eq {:algorithm=>"ES256", :digest=>"sha256"} - when unkown is given - raises an error - -JWT::JWK::HMAC - .new - when a secret key given - creates an instance of the class - #export - when key is exported with private key - returns a hash with the key - when key is exported - returns a hash with the key - .import - when secret key is given - returns a key - with a custom "kid" value - imports that "kid" value - -README.md code test - algorithm usage - EDDSA - decodes with HMAC algorithm without secret key - NONE - decodes with HMAC algorithm with secret key - RSASSA-PSS - ECDSA - RSA - claims - JWK with thumbprint given in the initializer - jti - sub - required_claims - iss - JWK with thumbprint as kid via type - JWK with thumbprint as kid via symbol - find_key - iat - without leeway - with leeway - custom header fields - with custom field - nbf - without leeway - with leeway - aud - string - array - exp - without leeway - with leeway - The JWK loader example - works as expected - -JWT::JWK - .import - creates a ::JWT::JWK::RSA instance - parsed from JSON - creates a ::JWT::JWK::RSA instance from JSON parsed JWK - when keytype is not supported - raises an error - when keypair with defined kid is imported - returns the predefined kid if jwt_data contains a kid - .new - when kid is given - sets the kid - when RSA key is given - is expected to be a kind of JWT::JWK::RSA - when EC key is given - is expected to be a kind of JWT::JWK::EC - when secret key is given - is expected to be a kind of JWT::JWK::HMAC - -JWT::Configuration::JwkConfiguration - .kid_generator_type= - when invalid value is passed - raises ArgumentError - when valid value is passed - sets the generator matching the value +Randomized with seed 57840 JWT - should encode string payloads - should not verify token even if the payload has claims should not raise InvalidPayload exception if payload is an array - alg: PS384 + should not verify token even if the payload has claims + should encode string payloads + a token with not too many segments + raises JWT::DecodeError + alg: ES256 should decode a valid token - wrong key should raise JWT::DecodeError should generate a valid token wrong key and verify = false should not raise JWT::DecodeError - when token ends with a newline char - ignores the newline and decodes the token - algorithm case insensitivity - ignores algorithm casing during encode/decode - raises error for invalid algorithm - when none token is and decoding without key and with verification - decodes the token - Invalid - raises "No verification key available" error - algorithm should raise NotImplementedError - ECDSA curve_name should raise JWT::IncorrectAlgorithm - alg: HS384 + wrong key should raise JWT::DecodeError + alg: HS512256 + wrong secret and verify = false should not raise JWT::DecodeError should decode a valid token - should generate a valid token wrong secret should raise JWT::DecodeError - wrong secret and verify = false should not raise JWT::DecodeError - alg: ES512 + should generate a valid token + alg: PS512 should decode a valid token wrong key should raise JWT::DecodeError should generate a valid token wrong key and verify = false should not raise JWT::DecodeError - when none token is decoded with a key given - decodes the token - when the alg value is given as a header parameter - should generate the same token - does not override the actual algorithm used - Verify - algorithm - should raise JWT::IncorrectAlgorithm on mismatch - should raise JWT::IncorrectAlgorithm on mismatch prior to kid public key network call - should raise JWT::IncorrectAlgorithm when algorithms array does not contain algorithm - no algorithm provided - should use the default decode algorithm - token is missing algorithm - should raise JWT::IncorrectAlgorithm - 2-segment token - should raise JWT::IncorrectAlgorithm - when key given as an array with multiple possible keys - should fail if only invalid keys are given - should be able to verify signature when multiple keys given as a parameter - should be able to verify signature when block returns multiple keys - when encoded payload is used to extract key through find_key - should be able to verify signature when block returns multiple keys - should be able to verify signature when block returns multiple keys with multiple issuers - should be able to find a key using the block passed to decode - should be able to find a key using a block with multiple issuers - should be able to find a key using the block passed to decode with iss verification - should be able to verify signature when block returns multiple keys with iss verification - issuer claim - if verify_iss is set to false (default option) should not raise JWT::InvalidIssuerError - when keyfinder given with 3 arguments - decodes the token but does not pass the payload - a token with invalid Base64 segments - raises JWT::DecodeError - alg: RS512 + alg: PS384 + wrong key and verify = false should not raise JWT::DecodeError + wrong key should raise JWT::DecodeError should generate a valid token + should decode a valid token + alg: ES256K wrong key and verify = false should not raise JWT::DecodeError wrong key should raise JWT::DecodeError should decode a valid token - should decode a valid token using algorithm hash string key - a token with no segments + should generate a valid token + alg: NONE + should generate a valid token + decoding with verification + without specifying the none algorithm + should fail to decode the token + specifying the none algorithm + when the claims are valid + should decode the token + when the claims are invalid + should fail to decode the token + decoding without verification + should decode a valid token + alg: HS384 + wrong secret should raise JWT::DecodeError + should decode a valid token + wrong secret and verify = false should not raise JWT::DecodeError + should generate a valid token + a token with invalid Base64 segments raises JWT::DecodeError - alg: ES256K + alg: ED25519 should decode a valid token should generate a valid token wrong key should raise JWT::DecodeError wrong key and verify = false should not raise JWT::DecodeError - alg: RS384 - wrong key should raise JWT::DecodeError - should decode a valid token - wrong key and verify = false should not raise JWT::DecodeError - should generate a valid token - should decode a valid token using algorithm hash string key - when none token is decoded without verify - decodes the token ::JWT.decode with verify_iat parameter - when iat is exactly the same as Time.now and iat is given as a float - considers iat valid when iat is exactly the same as Time.now and iat is given as floored integer considers iat valid when iat is 1 second before Time.now raises an error + when iat is exactly the same as Time.now and iat is given as a float + considers iat valid + when hmac algorithm is used without secret key + encodes payload + when none token is and decoding without key and with verification + decodes the token + when none token is decoded with a key given + decodes the token a token with not enough segments raises JWT::DecodeError - when keyfinder given with 2 arguments - decodes the token + alg: RS256 + should decode a valid token + should generate a valid token + wrong key should raise JWT::DecodeError + wrong key and verify = false should not raise JWT::DecodeError + should decode a valid token using algorithm hash string key + ::JWT.decode with x5c parameter + calls X5cKeyFinder#from to verify the signature and return the payload alg: PS256 + should generate a valid token wrong key and verify = false should not raise JWT::DecodeError wrong key should raise JWT::DecodeError - should generate a valid token should decode a valid token - alg: HS256 + when token signed with nil and decoded with nil + raises JWT::DecodeError + payload validation + validates the payload with the ClaimsValidator if the payload is a hash + does not validate the payload if it is not present + a token with no segments + raises JWT::DecodeError + algorithm case insensitivity + raises error for invalid algorithm + ignores algorithm casing during encode/decode + when token ends with a newline char + ignores the newline and decodes the token + alg: ES384 + wrong key should raise JWT::DecodeError should decode a valid token - wrong secret and verify = false should not raise JWT::DecodeError - should generate a valid token - wrong secret should raise JWT::DecodeError - alg: EdDSA should generate a valid token wrong key and verify = false should not raise JWT::DecodeError - should decode a valid token - wrong key should raise JWT::DecodeError + Invalid + algorithm should raise NotImplementedError + ECDSA curve_name should raise JWT::IncorrectAlgorithm + raises "No verification key available" error when keyfinder given with 1 argument decodes the token - ::JWT.decode with x5c parameter - calls X5cKeyFinder#from to verify the signature and return the payload - alg: NONE - should generate a valid token - decoding without verification - should decode a valid token - decoding with verification - without specifying the none algorithm - should fail to decode the token - specifying the none algorithm - when the claims are invalid - should fail to decode the token - when the claims are valid - should decode the token - when hmac algorithm is used without secret key - encodes payload - a token with two segments but does not require verifying - raises something else than "Not enough or too many segments" - alg: HS512256 - should generate a valid token - wrong secret should raise JWT::DecodeError - wrong secret and verify = false should not raise JWT::DecodeError - should decode a valid token - alg: PS512 - should generate a valid token + alg: EdDSA should decode a valid token wrong key and verify = false should not raise JWT::DecodeError wrong key should raise JWT::DecodeError - alg: ES384 - wrong key and verify = false should not raise JWT::DecodeError - should decode a valid token should generate a valid token - wrong key should raise JWT::DecodeError alg: HS512 - should generate a valid token should decode a valid token wrong secret should raise JWT::DecodeError wrong secret and verify = false should not raise JWT::DecodeError - when token signed with nil and decoded with nil - raises JWT::DecodeError - alg: ED25519 should generate a valid token - wrong key should raise JWT::DecodeError - wrong key and verify = false should not raise JWT::DecodeError + a token with two segments but does not require verifying + raises something else than "Not enough or too many segments" + alg: HS256 + wrong secret should raise JWT::DecodeError + should generate a valid token + wrong secret and verify = false should not raise JWT::DecodeError should decode a valid token - alg: RS256 + alg: RS384 should generate a valid token - wrong key and verify = false should not raise JWT::DecodeError + should decode a valid token using algorithm hash string key wrong key should raise JWT::DecodeError should decode a valid token - should decode a valid token using algorithm hash string key - payload validation - validates the payload with the ClaimsValidator if the payload is a hash - does not validate the payload if it is not present - a token with not too many segments - raises JWT::DecodeError - alg: ES256 + wrong key and verify = false should not raise JWT::DecodeError + alg: RS512 + wrong key should raise JWT::DecodeError should generate a valid token + should decode a valid token using algorithm hash string key + should decode a valid token wrong key and verify = false should not raise JWT::DecodeError + when the alg value is given as a header parameter + does not override the actual algorithm used + should generate the same token + when none token is decoded without verify + decodes the token + Verify + when encoded payload is used to extract key through find_key + should be able to verify signature when block returns multiple keys with multiple issuers + should be able to verify signature when block returns multiple keys + should be able to verify signature when block returns multiple keys with iss verification + should be able to find a key using a block with multiple issuers + should be able to find a key using the block passed to decode with iss verification + should be able to find a key using the block passed to decode + issuer claim + if verify_iss is set to false (default option) should not raise JWT::InvalidIssuerError + algorithm + should raise JWT::IncorrectAlgorithm on mismatch prior to kid public key network call + should raise JWT::IncorrectAlgorithm on mismatch + should raise JWT::IncorrectAlgorithm when algorithms array does not contain algorithm + no algorithm provided + should use the default decode algorithm + token is missing algorithm + should raise JWT::IncorrectAlgorithm + 2-segment token + should raise JWT::IncorrectAlgorithm + when key given as an array with multiple possible keys + should fail if only invalid keys are given + should be able to verify signature when multiple keys given as a parameter + should be able to verify signature when block returns multiple keys + when keyfinder given with 3 arguments + decodes the token but does not pass the payload + when keyfinder given with 2 arguments + decodes the token + alg: ES512 should decode a valid token wrong key should raise JWT::DecodeError + wrong key and verify = false should not raise JWT::DecodeError + should generate a valid token -JWT::X5cKeyFinder - returns the public key from a certificate that is signed by trusted roots and not revoked - ::JWT.decode - returns the encoded payload after successful certificate path verification - CRL - not given - raises an error - expired - raises an error - signature could not be verified with the given trusted roots - raises an error - already parsed certificates - returns the public key from a certificate that is signed by trusted roots and not revoked - certificate - revoked - raises an error - could not be chained to a trusted root certificate - given an array - raises a verification error - given nil - raises a decode error - signature could not be verified with the given trusted roots - raises an error - expired - raises an error - -JWT - JWT.configure - yields the configuration - allows configuration to be changed via the block +JWT::JWK::Thumbprint + #to_s + when HMAC key is given + is expected to eq "wPf4ZF5qlzoFxsGkft4eu1iWcehgAcahZL4XPV4dT-s" + when EC key is given + is expected to eq "dO52_we59sdR49HsGCpVzlDUQNvT3KxCTGakk4Un8qc" + when example from RFC is given + is expected to eq "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs" -JWT::JWK::RSA - .new - when a keypair with both keys given - creates an instance of the class - when a keypair with only public key is given - creates an instance of the class - #export - when unsupported keypair is given - raises an error - when keypair with public key is exported - returns a hash with the public parts of the key - when private key is requested - returns a hash with the public AND private parts of the key - when keypair with private key is exported - returns a hash with the public parts of the key - .kid - when kid is given as a String parameter - uses the given kid - when kid is given as in a hash parameter - uses the given kid - when configuration says to use :rfc7638_thumbprint - generates the kid based on the thumbprint +JWT::JWK .import - when keypair is imported with string keys from JSON - returns a hash with the public parts of the key - when private key is included in the data - creates a complete keypair - when jwk_data is given without e and/or n + creates a ::JWT::JWK::RSA instance + when keytype is not supported raises an error - when keypair is imported with symbol keys - returns a hash with the public parts of the key + when keypair with defined kid is imported + returns the predefined kid if jwt_data contains a kid + parsed from JSON + creates a ::JWT::JWK::RSA instance from JSON parsed JWK + .new + when RSA key is given + is expected to be a kind of JWT::JWK::RSA + when secret key is given + is expected to be a kind of JWT::JWK::HMAC + when EC key is given + is expected to be a kind of JWT::JWK::EC + when kid is given + sets the kid JWT::JWK::EC .import - when crv=P-384 + when crv=P-256 when keypair is public returns a public key returns a hash with the public parts of the key @@ -1442,7 +1200,7 @@ returns a private key with a custom "kid" value imports that "kid" value - when crv=P-521 + when crv=P-256K when keypair is private returns a private key with a custom "kid" value @@ -1450,55 +1208,178 @@ when keypair is public returns a public key returns a hash with the public parts of the key - when crv=P-256K + when crv=P-384 + when keypair is public + returns a public key + returns a hash with the public parts of the key when keypair is private returns a private key with a custom "kid" value imports that "kid" value + when crv=P-521 when keypair is public returns a public key returns a hash with the public parts of the key - when crv=P-256 when keypair is private returns a private key with a custom "kid" value imports that "kid" value - when keypair is public - returns a public key - returns a hash with the public parts of the key + .new + when a keypair with only public key is given + creates an instance of the class + when a keypair with both keys given + creates an instance of the class #export - when private key is requested - returns a hash with the both parts of the key when keypair with public key is exported returns a hash with the public parts of the key when a custom "kid" is provided exports it when keypair with private key is exported returns a hash with the both parts of the key + when private key is requested + returns a hash with the both parts of the key + +README.md code test + claims + JWK with thumbprint as kid via symbol + required_claims + sub + find_key + jti + JWK with thumbprint as kid via type + JWK with thumbprint given in the initializer + iss + The JWK loader example + works as expected + nbf + without leeway + with leeway + aud + array + string + custom header fields + with custom field + iat + without leeway + with leeway + exp + with leeway + without leeway + algorithm usage + RSA + decodes with HMAC algorithm without secret key + decodes with HMAC algorithm with secret key + EDDSA + NONE + RSASSA-PSS + ECDSA + +JWT::X5cKeyFinder + returns the public key from a certificate that is signed by trusted roots and not revoked + ::JWT.decode + returns the encoded payload after successful certificate path verification + already parsed certificates + returns the public key from a certificate that is signed by trusted roots and not revoked + CRL + expired + raises an error + not given + raises an error + signature could not be verified with the given trusted roots + raises an error + certificate + expired + raises an error + revoked + raises an error + could not be chained to a trusted root certificate + given nil + raises a decode error + given an array + raises a verification error + signature could not be verified with the given trusted roots + raises an error + +JWT::Algos::Ecdsa + .curve_by_name + when prime256v1 is given + is expected to eq {:algorithm=>"ES256", :digest=>"sha256"} + when secp521r1 is given + is expected to eq {:algorithm=>"ES512", :digest=>"sha512"} + when secp256r1 is given + is expected to eq {:algorithm=>"ES256", :digest=>"sha256"} + when unkown is given + raises an error + when secp256k1 is given + is expected to eq {:algorithm=>"ES256K", :digest=>"sha256"} + +JWT::Configuration::JwkConfiguration + .kid_generator_type= + when valid value is passed + sets the generator matching the value + when invalid value is passed + raises ArgumentError + +JWT::JWK::RSA + .import + when jwk_data is given without e and/or n + raises an error + when keypair is imported with symbol keys + returns a hash with the public parts of the key + when keypair is imported with string keys from JSON + returns a hash with the public parts of the key + when private key is included in the data + creates a complete keypair .new + when a keypair with both keys given + creates an instance of the class when a keypair with only public key is given creates an instance of the class - when a keypair with both keys given + .kid + when kid is given as a String parameter + uses the given kid + when kid is given as in a hash parameter + uses the given kid + when configuration says to use :rfc7638_thumbprint + generates the kid based on the thumbprint + #export + when unsupported keypair is given + raises an error + when keypair with private key is exported + returns a hash with the public parts of the key + when keypair with public key is exported + returns a hash with the public parts of the key + when private key is requested + returns a hash with the public AND private parts of the key + +JWT::JWK::HMAC + .new + when a secret key given creates an instance of the class + #export + when key is exported with private key + returns a hash with the key + when key is exported + returns a hash with the key + .import + when secret key is given + returns a key + with a custom "kid" value + imports that "kid" value JWT .decode for JWK usecase - when jwk keys are loaded using a proc/lambda - decodes the token - when jwk keys are rotated + when jwk keys are loaded from JSON with string keys decodes the token when JWK features are used manually is able to decode the token - when jwk keys are given as an array - and kid is in the set - is able to decode the token - no keys are found in the set - raises an exception - and kid is not in the set - raises an exception - token does not know the kid - raises an exception + when jwk keys are rotated + decodes the token mixing algorithms using kid header + when EC key is pointed to as RSA public key + fails in some way + when EC key is pointed to as HMAC secret + fails in some way when HMAC secret is pointed to as EC public key fails in some way when HMAC secret is pointed to as RSA public key @@ -1507,17 +1388,154 @@ fails in some way when RSA key is pointed to as HMAC secret fails in some way - when EC key is pointed to as RSA public key - fails in some way - when EC key is pointed to as HMAC secret - fails in some way - when jwk keys are loaded from JSON with string keys + when jwk keys are given as an array + and kid is in the set + is able to decode the token + no keys are found in the set + raises an exception + token does not know the kid + raises an exception + and kid is not in the set + raises an exception + when jwk keys are loaded using a proc/lambda decodes the token -Finished in 48.55 seconds (files took 1.22 seconds to load) +JWT::Verify + .verify_iat(payload, options) + must allow a valid iat + must raise JWT::InvalidIatError when the iat value is not Numeric + must raise JWT::InvalidIatError when the iat value is in the future + must properly handle integer times + must ignore configured leeway + .verify_claims + must skip verification when verify_sub option is set to false + must skip verification when verify_aud option is set to false + must skip verification when verify_not_before option is set to false + must raise error when verify_iat option is set to true + must raise error when verify_jti option is set to true + must raise error when verify_sub option is set to true + must raise error when verify_aud option is set to true + must skip verification when verify_expiration option is set to false + must skip verification when verify_iat option is set to false + must skip verification when verify_iss option is set to false + must skip verification when verify_jti option is set to false + must raise error when verify_not_before option is set to true + must raise error when verify_expiration option is set to true + must raise error when verify_iss option is set to true + .verify_jti(payload, options) + true proc should not raise JWT::InvalidJtiError + must raise JWT::InvalidJtiError when the jti is missing + must raise JWT::InvalidJtiError when the jti is an empty string + should have payload as second param in proc + must raise JWT::InvalidJtiError when verify_jti proc returns false + must allow any jti when the verfy_jti key in the options is truthy but not a proc + it should not throw arguement error with 2 args + .verify_expiration(payload, options) + must raise JWT::ExpiredSignature when the token has expired + must be expired if the exp claim equals the current time + must allow some leeway in the expiration when global leeway is configured + must allow some leeway in the expiration when exp_leeway is configured + when leeway is not specified + used a default leeway of 0 + .verify_iss(payload, options) + when iss is an Array + must raise JWT::InvalidIssuerError when the payload does not include an issuer + must raise JWT::InvalidIssuerError when no matching issuers in array + must allow an array with matching issuer to pass + when iss is a String + must raise JWT::InvalidIssuerError when the configured issuer does not match the payload issuer + must allow a matching issuer to pass + must raise JWT::InvalidIssuerError when the payload does not include an issuer + when iss is a RegExp + must raise JWT::InvalidIssuerError when the payload does not include an issuer + must allow a regular expression matching the issuer to pass + must raise JWT::InvalidIssuerError when the regular expression does not match + when iss is a Method instance + must raise JWT::InvalidIssuerError when the method returns false + must allow a method that returns true to pass + must raise JWT::InvalidIssuerError when the payload does not include an issuer + when iss is a Proc + must raise JWT::InvalidIssuerError when the payload does not include an issuer + must allow a proc that returns true to pass + must raise JWT::InvalidIssuerError when the proc returns false + .verify_not_before(payload, options) + must allow some leeway in the token age when nbf_leeway is configured + must raise JWT::ImmatureSignature when the nbf in the payload is in the future + must allow some leeway in the token age when global leeway is configured + .verify_sub(payload, options) + must allow a matching sub + must raise JWT::InvalidSubError when the subjects do not match + .verify_required_claims(payload, options) + must raise JWT::MissingRequiredClaim if a required claim is absent + must verify the claims if all required claims are present + .verify_aud(payload, options) + must raise JWT::InvalidAudError when the singular audience does not match + must allow a matching singular audience to pass + must allow a singular audience payload matching any value in the options array + must raise JWT::InvalidAudError when the payload has an array and none match the supplied value + must allow an array with any value matching the one in the options + must allow an array with any value matching any value in the options array + +JWT::ClaimsValidator + #validate! + iat claim + it should behave like a NumericDate claim + when iat payload is a Time object + raises error + when iat payload is a string + raises error + when iat payload is an integer + does not raise error + and key is a string + does not raise error + when iat payload is a float + does not raise error + when iat payload is a string + raises error + and key is a string + raises error + exp claim + it should behave like a NumericDate claim + when exp payload is a Time object + raises error + when exp payload is a string + raises error + and key is a string + raises error + when exp payload is a string + raises error + when exp payload is a float + does not raise error + when exp payload is an integer + does not raise error + and key is a string + does not raise error + nbf claim + it should behave like a NumericDate claim + when nbf payload is a float + does not raise error + when nbf payload is an integer + does not raise error + and key is a string + does not raise error + when nbf payload is a Time object + raises error + when nbf payload is a string + raises error + and key is a string + raises error + when nbf payload is a string + raises error + +JWT + JWT.configure + yields the configuration + allows configuration to be changed via the block + +Finished in 45.65 seconds (files took 1.53 seconds to load) 304 examples, 0 failures -Randomized with seed 984 +Randomized with seed 57840 Coverage report generated for RSpec to /build/ruby-jwt-2.5.0/coverage. 752 / 794 LOC (94.71%) covered. @@ -1550,12 +1568,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: including full source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/5945/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/14869 and its subdirectories -I: Current time: Sun May 12 08:33:19 -12 2024 -I: pbuilder-time-stamp: 1715545999 +I: removing directory /srv/workspace/pbuilder/5945 and its subdirectories +I: Current time: Tue Apr 11 04:12:37 +14 2023 +I: pbuilder-time-stamp: 1681135957