jwt/ruby-jwt
63.6
Adequate · 14 November 2026
2.4k
lines of production code
Ruby
primary language
5
measurements over time
What this system is
Features
Added development console and smoke test scripts
Two new executable scripts have been added to the bin directory to aid in development and verification. The new bin/console.rb script provides an IRB console environment with the library loaded, allowing developers to interactively test features. Additionally, bin/smoke.rb serves as a quick sanity check by performing a simple encode/decode operation using the HS256 algorithm and printing the current gem version.
bin · high confidence
Introduce dedicated JWK classes for RSA, EC, and HMAC keys
The library now includes specific \JWT::JWK::RSA\, \JWT::JWK::EC\, and \JWT::JWK::HMAC\ classes to handle JSON Web Keys, replacing the previous generic handling. This change enables proper support for Elliptic Curve (EC) keys, including the secp256k1 curve, and HMAC keys with correct base64url encoding of the \k\ value. It also introduces a \KeyFinder\ component to locate keys by \kid\ from a JWKS source, a \Set\ class to manage collections of JWKs, and a \Thumbprint\ class to generate JWK thumbprints (x5t/x5t\#S256) as key identifiers.
lib/jwt/jwk · high confidence
Behavioural changes
JWT claim validation refactored into modular classes
The JWT library has restructured how standard claims (such as \exp\, \nbf\, \iat\, \iss\, \aud\, \sub\, \jti\, and \crit\) are validated. Instead of inline logic, each claim is now handled by a dedicated class (e.g., \Claims::Expiration\, \Claims::Audience\) within the \lib/jwt/claims\ directory. This change introduces a new \DecodeVerifier\ module that orchestrates these validators during token decoding, allowing for more granular control and consistent error handling. Users will see this as a behavioral change in how claim verification is executed, potentially affecting custom validation logic or error messages, while maintaining support for existing configuration options like leeway for time-based claims.
lib/jwt/claims · high confidence
JWT library refactored into modular components with updated API
The JWT library has been significantly refactored from a single-file implementation into a modular structure, introducing separate classes and modules for encoding, decoding, configuration, JWK handling, and claims validation. This change updates the public API: the \encode\ method now accepts an optional \header\_fields\ argument to allow custom headers, and the \decode\ method now returns an array containing both the decoded payload and headers (previously it returned only the payload). The library also enforces the \frozen\_string\_literal\ pragma and updates its internal dependencies to use standard library modules where possible.
lib · high confidence
JWT library restructured into modular classes with new token verification model
The JWT library has been refactored from a procedural API into a modular class-based architecture, introducing dedicated classes for encoding (JWT::Encode), decoding (JWT::Decode), and token representation (JWT::Token, JWT::EncodedToken). This change introduces a new verification model where payload access is strictly gated behind signature and claim verification steps, preventing accidental exposure of unverified data. It also adds support for detached payloads, X.509 certificate chain verification via the x5c header, and a centralized configuration system, while replacing legacy base64 and JSON handling with dedicated internal modules.
lib/jwt · high confidence
New structured configuration system for JWT decoding and JWK handling
JWT now provides a dedicated configuration API to manage decoding behavior and JWK key ID generation. Users can configure time-based claim verification (expiration, not-before, issuer, issued-at, JWT ID, audience, subject) along with a global leeway for time checks. The system introduces an option to enforce minimum HMAC key lengths for security and allows control over deprecation warning verbosity (once, warn, or silent). Additionally, JWK key ID generation can be switched between the default key digest and RFC 7638 thumbprints, offering flexibility in how keys are identified in tokens.
lib/jwt/configuration · high confidence
Refactored JWT signing algorithms into a modular JWA structure
The internal implementation of JWT signing algorithms (HMAC, RSA, ECDSA, PS, and none) has been reorganized into distinct, modular classes within the JWA (JSON Web Algorithms) module. This change introduces context objects to manage signing and verification keys, enforces stricter key type validation (e.g., requiring ECDSA keys to be OpenSSL::PKey::EC instances and RSA keys to be at least 2048 bits), and adds support for using EC public points as verification keys. Users benefit from improved security through better key validation and a more extensible algorithm structure, while maintaining compatibility with existing JWT signing and verification workflows.
lib/jwt/jwa · high confidence
Standardize development tooling and project configuration
The project now includes explicit configuration files for its development and testing infrastructure: \.rubocop.yml\ enforces code style (targeting Ruby 2.5+), \.rspec\ configures the test runner, \.markdownlint.json\ adjusts markdown linting, \.simplecov\ sets up code coverage reporting, and \.yardopts\ defines YARD documentation generation. The \Rakefile\ has been rewritten to use Bundler and invoke RSpec and RuboCop tasks, replacing the previous Echoe-based build system. Additionally, \CODE\_OF\_CONDUCT.md\ and \CONTRIBUTING.md\ have been added to guide community participation, while the legacy \Manifest\ file has been removed.
(repo-wide) · high confidence
Test coverage
Added Appraisal gemfiles for OpenSSL and standalone testing environments; Added comprehensive test coverage for JWA signing algorithms; Added comprehensive test coverage for JWT 3.0 core components; Added integration tests for README examples; Added test coverage for JWK decoding, key types, and set operations; Added test coverage for JWT claim validation classes; Added test fixtures for EC and RSA key pairs; Added test helpers for key handling and token structures; Migrate test suite to RSpec and modernize test infrastructure.
Dependencies
Initial gemspec and Gemfile setup for JWT library
The project now includes a Gemfile and a ruby-jwt.gemspec file to define the package structure. The gemspec specifies a minimum Ruby version of 2.5, declares a runtime dependency on the 'base64' standard library, and lists development dependencies including 'appraisal', 'bundler', 'irb', 'logger', 'rake', 'rspec', 'rubocop', and 'simplecov'. It also configures metadata for bug tracking, changelogs, and requires multi-factor authentication for gem uploads.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 67 → 64 (-3.4)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 76 → 73 (-2.1)
- Architecture 97 → 97 (+0.0)
- Maturity 59 → 58 (-1.2)
- Readiness 70 → 70 (+0.0)
- Security 75 → 62 (-12.6)
Resolved (1)
- Off-boarding risk: anonymized user #1
New (2)
- Edited copies of one member (3 members, 3+ corresponding lines) (lib/jwt/jwk/ec.rb)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 12 commits — 12 feature/other, 0 fixes
By area
- (root) — 6 commits
- .github/workflows — 5 commits
- lib/jwt — 1 commit
Notable commits
- change: Accept the RFC 8812 secp256k1 curve name for EC JWKs (#787)
- change: Bump qltysh/qlty-action/coverage from 2.4.0 to 2.5.0 (#776)
- change: Bump ruby/setup-ruby from 1.329.0 to 1.334.0 (#777)
- change: Bump ruby/setup-ruby from 1.334.0 to 1.335.0 (#790)
- change: Bump ruby/setup-ruby from 1.335.0 to 1.336.0 (#791)
- change: Check the token algorithm before calling the key finder (#784)
- change: Ignore unsupported kty when a Set is built from an array (RFC 7517 §5) (#744)
- change: Raise JWT::JWKError for EC JWK coordinates not on the curve (#789)
- change: Raise JWT::MalformedTokenError for a non-object token header (#783)
- change: Redact private JWK material from inspection (#754)
- change: Reject too many segments in JWT::EncodedToken (#782)
- change: Run Ruby 3.1 and older on ubuntu-24.04 in CI (#778)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
jwt/ruby-jwt was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c22701ef8e0e0a33e4fbfaebee36fc48acba1a08 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.