Skip to content
CAI
Software that uses CAICheck a score

ambethia/recaptcha

62.0

Adequate · 6 November 2026

1.2k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Sinatra demo application for reCAPTCHA verification

A new demo application has been added in the demo/sinatra directory, providing a working example of integrating reCAPTCHA with the Sinatra web framework. The included server.rb file demonstrates how to configure site and secret keys, render reCAPTCHA tags in a form, and verify user responses on the backend.

demo/sinatra · high confidence

Added User model example in demo Rails app

A new User model file has been added to the demo Rails application, providing a basic ActiveRecord::Base class structure as a reference example.

recaptcha · high confidence

Rails demo app adds v3 support with v2 fallback and multiple usage examples

The Rails demo application now includes comprehensive examples for reCAPTCHA v3, featuring a new V3CaptchasController and views that demonstrate single-action verification, multi-action verification, custom JavaScript callbacks, and executing verification on form submit. A key addition is the v3-to-v2 fallback pattern, which automatically presents a v2 checkbox challenge if the v3 score is below the configured threshold. The demo also retains and clarifies v2 examples, including invisible reCAPTCHA support and multi-widget setups, and provides a User model example to show model-based verification.

demo/rails · high confidence

Removals

Removed empty ReCAPTCHA rake task

The placeholder Rake task for ReCAPTCHA has been removed from the project. This cleanup eliminates an unused file that contained only commented-out code, streamlining the task namespace.

tasks · high confidence

Behavioural changes

Major architectural refactor and reCAPTCHA v2/v3 support

The library has been completely rewritten from the legacy Ambethia namespace to a modern Recaptcha module, introducing support for reCAPTCHA v2 and v3 as well as reCAPTCHA Enterprise. This change replaces the previous controller-based validation with a new configuration-driven architecture, separating concerns into dedicated adapters for controller and view methods. Users will now interact with a centralized configuration object, can pass options like private keys and timeouts directly to verification methods, and benefit from improved error handling via a new Reply class and specific VerifyError exceptions. The diff also shows the removal of the old hardcoded API servers in favor of configurable URLs and the addition of JSON POST support for verification requests.

lib · high confidence

Rails demo app scaffolded with version 5.2 configuration defaults

The demo application in demo/rails/config has been initialized with a standard Rails 5.2 project structure, including environment-specific configurations for development, test, and production, as well as initializers for assets, cookies, and session management. The setup explicitly loads Rails 5.0 defaults while providing the new\_framework\_defaults\_5\_2 initializer to guide the migration to 5.2 behaviors, and configures the application to use SQLite for the database and Redis for Action Cable in production.

demo/rails/config · high confidence

ReCAPTCHA gem updated to v5.21.2 with configuration and v3 support

The lib/recaptcha gem has been updated to version 5.21.2. This release introduces a new \Recaptcha::Configuration\ class that centralizes settings such as site/secret keys, proxy settings, and API URLs, allowing configuration via \Recaptcha.configure\ or environment variables. It adds support for reCAPTCHA v3, including view helpers for generating v3 tags and handling actions, and introduces a \Recaptcha::Reply\ class to handle verification responses with support for enterprise features like hostname validation and score thresholds. The update also includes improvements to timeout handling and error messages.

lib/recaptcha · high confidence

Refactored reCAPTCHA adapters with v3 support and improved error handling

The reCAPTCHA library has been refactored to extract adapter logic into dedicated modules, introducing explicit support for reCAPTCHA v3 alongside existing v2 options. Controllers now expose the reCAPTCHA reply and failure reason, providing users with detailed error messages (such as score thresholds or API errors) rather than generic failures. Additionally, flash messages are now supported for Turbo Stream requests, and the parameter name for v3 responses has been updated to 'g-recaptcha-response-data' to distinguish it from v2.

lib/recaptcha/adapters · high confidence

Repository modernization and RuboCop configuration

The project has been modernized by introducing a RuboCop configuration file (.rubocop.yml) targeting Ruby 3.0, updating the Rakefile to use Bundler and run RuboCop by default, and adding a .gitignore file to exclude generated documentation and demo lockfiles. Legacy plugin hooks (init.rb, install.rb, uninstall.rb) have been removed, and the documentation has been consolidated into a new README.md with a table of contents, replacing the old README file.

(repo-wide) · high confidence

Test coverage

Added comprehensive test suite for reCAPTCHA view helpers, configuration, and controller verification

This change introduces a new, structured test suite for the reCAPTCHA library, replacing the legacy test/unit-based tests with a modern Minitest/Maixmest framework. The new tests cover client helper view methods (including \recaptcha\_tags\ and \invisible\_recaptcha\_tags\), verifying that HTML attributes like \id\, \tabindex\, \nonce\, \data-expired-callback\, and \data-error-callback\ are rendered correctly, and that options like \script: false\ or \turbolinks: true\ behave as expected. It also adds tests for the \Recaptcha::Configuration\ class, ensuring that \api\_server\_url\, \verify\_url\, and block-based configuration overrides work correctly for both free and enterprise APIs. Finally, it includes extensive controller helper tests for \verify\_recaptcha\ and \verify\_recaptcha!\, covering success/failure scenarios, error handling, I18n translation of error messages, timeout handling, and validation of response lengths and remote IPs.

test · high confidence

Dependencies

Initial release of the recaptcha gem (v5.21.2) with Ruby 3.0+ support

This change introduces the recaptcha gem, providing helpers for the reCAPTCHA API, with a minimum requirement of Ruby 3.0.0. The package includes a Gemfile and gemspec that define development dependencies such as rubocop, mocha, webmock, and i18n, alongside demo applications for Rails 5.2 and Sinatra to illustrate integration.

(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 62 → 62 (+0.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 56 → 59 (+3.4)
  • Readiness 58 → 58 (+0.0)
  • Security 76 → 65 (-11.2)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (4)

  • Confusing naming convention: The existence of specific 'enterprise' and 'free' variants alongside a generic 'verify_via_api_call' suggests the generic method might be a dispatcher or deprecated. If the generic method dispatches to the specific ones, the specific ones should likely be private or internal. If they are all public, users must guess which to use, or the generic one is redundant.
  • Duplicate intent: Both ViewMethods and Helpers expose an identical method signature for rendering reCAPTCHA v2 tags. Same ambiguity as above regarding the canonical source.
  • Duplicate intent: Both ViewMethods and Helpers expose an identical method signature for rendering reCAPTCHA v3 scripts. It is unclear which module is the canonical source for view helpers, leading to potential confusion about which module to include or extend.
  • Duplicate intent: Both ViewMethods and Helpers expose methods for invisible reCAPTCHA tags. While the parameter name differs slightly ('options' vs 'custom'), the intent and likely implementation overlap significantly.

Changes since last survey

  • 2 commits — 0 feature/other, 2 fixes

By area

  • (repo) — 1 commit
  • (root) — 1 commit

Notable commits

  • fix: Fix shell export assignments in README
  • fix: Merge pull request #479 from dajiaohuang/fix-readme-shell-exports

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

ambethia/recaptcha 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 6 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 eaff28e4b302f854e4ae2d2a1c968c42b3b53746 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — 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.2+preprod-5c4e66d9318b.