Skip to content
CAI
Software that uses CAICheck a score

lostisland/faraday

68.8

Adequate · 14 November 2026

3.7k

lines of production code

Ruby

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Initialize Faraday library with default Net::HTTP adapter and connection options

The main Faraday library file has been initialized to load core components (Connection, Middleware, Adapters, Utils) and establish a default configuration using the \:net\_http\ adapter. It provides a \Faraday.new\ method that merges user-provided options with \default\_connection\_options\, and exposes HTTP verb shortcuts (GET, POST, etc.) on the \Faraday\ module itself by forwarding calls to a lazily-initialized \default\_connection\. The library also sets \ignore\_env\_proxy\ to false by default and defines paths for autoloading.

lib · high confidence

Introduce case-insensitive HTTP headers and string-keyed params hashes

Added new utility classes \Faraday::Utils::Headers\ and \Faraday::Utils::ParamsHash\ to standardize how HTTP headers and query parameters are handled. \Headers\ provides a case-insensitive hash that preserves the original casing of header names and correctly parses raw HTTP header strings, while \ParamsHash\ ensures all parameter keys are consistently converted to strings for predictable lookups and serialization.

lib/faraday/utils · high confidence

Introduce customizable Faraday logging formatter

A new \Faraday::Logging::Formatter\ class is introduced to provide a structured and customizable way to log HTTP requests, responses, and errors. Users can now control which details are logged via options such as \headers\, \bodies\, and \errors\, and can specify the \log\_level\ for these entries. The formatter safely handles exceptions raised during the request cycle, preventing crashes when logging errors, and ensures body content is encoded to UTF-8. This replaces or supplements previous ad-hoc logging mechanisms with a consistent, inheritable interface.

lib/faraday/logging · high confidence

Introduces a new Test adapter for mocking HTTP requests

Adds a new \Faraday::Adapter::Test\ class that allows users to stub HTTP requests for testing purposes. This adapter supports defining matchers for various HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) using paths, regular expressions, or full URLs. It includes features such as strict mode for exact matching, support for Proc-based body validation, thread-safe stub management via a mutex, and utilities to clear stubs or verify that all expected calls were made.

lib/faraday/adapter · high confidence

New request middleware for Authorization, JSON, URL-encoded bodies, and instrumentation

This change introduces four new request middleware components to Faraday. The Authorization middleware now supports callable/proc-based credentials for dynamic token generation and ensures headers are not modified if already present. The JSON middleware allows for configurable encoders (including custom objects or array-based configurations) and handles boolean values correctly. The UrlEncoded middleware enables file objects as request bodies and respects the connection's params\_encoder option. Additionally, an Instrumentation middleware is added to measure request duration using ActiveSupport::Notifications or a custom instrumenter.

lib/faraday/request · high confidence

Behavioural changes

Faraday library updated to version 2.14.4

The Faraday HTTP client library has been updated to version 2.14.4. This release includes 56 fixes addressing various issues within the library, such as improvements to request and response handling, middleware configuration, and proxy support. The update also involves refactoring of internal components like the adapter registry and middleware stack, along with general code quality improvements and RuboCop linting fixes.

lib/faraday · high confidence

Modernized bin scripts for setup, testing, and console

The repository now provides updated shell scripts in the bin directory to streamline common development tasks. The new bin/setup script automates the installation of Bundler and project dependencies. The bin/test script has been consolidated to run both RuboCop linting and RSpec tests in a single step. Additionally, a new bin/console script is available to launch an IRB session with the gem's dependencies pre-loaded, facilitating easier experimentation. Also in this area: Updated local integration test runner to use Docker instead of act.

bin · high confidence

Refactored error handling and request structure

Faraday now uses a new \Faraday::Error\ base class that wraps original exceptions and includes HTTP response details (status, headers, body) in all client and server errors, providing more context in logs. Specific error classes like \BadRequestError\, \ResourceNotFound\, and \UnprocessableContentError\ are raised for corresponding HTTP status codes. Additionally, the \Faraday::Request\ object has been refactored to use a Struct-based implementation with improved handling of params, headers, and options, and now supports Marshal serialization.

faraday · high confidence

Refactored options into dedicated, structured classes

The single, monolithic options hash has been split into distinct, type-safe classes: ConnectionOptions, RequestOptions, ProxyOptions, SSLOptions, and Env. This change introduces structured configuration for proxy settings (including automatic scheme defaults and empty-string handling), SSL/TLS parameters (such as SNI hostname support, verify\_hostname, and cipher lists), and request timeouts (separating read\_timeout from open\_timeout). Users benefit from clearer configuration APIs, better documentation via YARD, and improved thread safety by avoiding mutation of shared proxy option hashes.

lib/faraday/options · high confidence

Refactored parameter encoders into dedicated files with configurable sorting and array indexing

The parameter encoding logic has been split into two distinct modules: FlatParamsEncoder and NestedParamsEncoder. FlatParamsEncoder handles simple flat hashes where array values repeat the parameter key multiple times (e.g., \a=one&a=two\), while NestedParamsEncoder manages complex nested structures using bracket notation (e.g., \a\[b\]=1\). Both encoders now support configurable parameter sorting via a \sort\_params\ flag, which defaults to true to ensure consistent ordering for OAuth and caching. Additionally, NestedParamsEncoder introduces an \array\_indices\ option; when enabled, it includes numeric indices in array keys (e.g., \a\[0\]=1\) instead of empty brackets, and enforces a configurable \param\_depth\_limit\ to prevent excessive nesting.

lib/faraday/encoders · high confidence

Repository modernization and tooling cleanup

The repository has been modernized by removing legacy tooling and documentation formats: the Jeweler gem build system and RDoc support have been dropped in favor of Bundler and RSpec, the README has been converted from RDoc to Markdown, and the .document file has been removed. New configuration files have been added to standardize development practices, including .editorconfig for consistent formatting, .rspec for test runner defaults, .yardopts for documentation generation, and .cursorrules to provide AI assistant guidelines. Additionally, the LICENSE file was renamed to LICENSE.md, the copyright year was updated to 2026, and the .gitignore was expanded to exclude modern build artifacts and AI planning files.

(repo-wide) · high confidence

Response middleware moved to lib/faraday/response

The JSON, Logger, and RaiseError response middleware have been relocated from the faraday\_middleware gem into the core Faraday library under lib/faraday/response. This change makes these capabilities available directly in Faraday without requiring an external dependency, with the JSON middleware now supporting configurable decoders and the RaiseError middleware offering options to control request data inclusion and allowed status codes.

lib/faraday/response · high confidence

Test coverage

Added RSpec test suite and configuration for Faraday; Added example tests for the Faraday Test adapter; Added integration test infrastructure for SSL and proxy options; Added integration tests for JSON literal request bodies; Added integration tests for connection options and parallel support; Added shared RSpec examples for adapter, params encoder, and request method testing; Added test coverage for Faraday options classes; Added test coverage for Faraday::Utils::Headers; Added test coverage for FlatParamsEncoder and NestedParamsEncoder; Added test coverage for JSON, Logger, and RaiseError response middleware; Added test coverage for core Faraday components; Added test coverage for request middleware components; Added test suite for the Test adapter; Added test support utilities for Faraday specs; Removed legacy test-unit test files.

Dependencies

Initialize Ruby and JavaScript dependency manifests

This change introduces the initial dependency configuration for the project by adding a Gemfile and faraday.gemspec for the Ruby library, and a package.json with package-lock.json for the documentation site. The Ruby side specifies a minimum Ruby version of 3.0, runtime dependencies on faraday-net\_http (\>= 2.0, \< 3.5), json, and logger, along with development and test dependencies including rack (\~\> 3.0), rspec (\~\> 3.7), webmock (\~\> 3.4), and RuboCop. The JavaScript side adds docsify-cli 5.0.0 as a dependency for serving the documentation.

(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

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 70 → 69 (-0.9)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 75 → 73 (-2.1)
  • Architecture 95 → 96 (+0.1)
  • Maturity 61 → 61 (+0.0)
  • Readiness 74 → 74 (+0.0)
  • Security 81 → 76 (-5.4)

Resolved (10)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Off-boarding risk: anonymized user #1
  • Rotate the exposed credentials — git history can't be un-committed
  • Secret: aws-access-token (.travis.yml)

New (3)

  • AWS access key ID with no secret key beside it (.travis.yml)
  • Edited copies of one member (3 members, 3+ corresponding lines) (lib/faraday/request/json.rb)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 13 commits — 11 feature/other, 2 fixes

By area

  • .github/workflows — 5 commits
  • lib/faraday — 4 commits
  • spec/faraday — 2 commits
  • (root) — 1 commit
  • docs/customization — 1 commit

Notable commits

  • fix: fix: honor include_request: false in all errors
  • fix: fix: keep Response API when omitting request data
  • change: Bump ruby/setup-ruby from 1.321.0 to 1.334.0
  • change: Bump ruby/setup-ruby from 1.334.0 to 1.335.0
  • change: Bump ruby/setup-ruby from 1.335.0 to 1.336.0 (#1734)
  • change: Bump ruby/setup-ruby from 1.336.0 to 1.338.0
  • change: Document options supported by the Net::HTTP adapter (#1731)
  • change: Escape params 2x faster with half the allocations, using CGI.escape (#1727)
  • change: Foundation: Create OptionsLike module and BaseOptions class (#1656)
  • change: Keep header index synchronized across Hash mutations (#1700)
  • change: Pin GitHub Actions used by CI and releases (#1710)
  • change: Version bump to 2.15.1
  • change: [MEDIUM] Lock the RubyGems release dependency graph (#1712)

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

lostisland/faraday 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 565a149d4038d7adeb47bdc265ceabe59e1b403a — 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-36d4cd83012f.