All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
config.log_request_bodiesoption (defaultfalse) to opt into logging request payloads at:debug- Granular API error classes are now actually raised:
BadRequestError(400),UnauthorizedError(401),NotFoundError(404), in addition toAuthenticationError(403) andRateLimitError(429) Dadata::TimeoutError(subclass ofConnectionError), raised on request timeoutsClientBase#closeto release persistent connections (previouslyClient#closeraisedNoMethodError)
- BREAKING: Published to RubyGems as
dadata-rb(thedadataname was already taken). Installs from git must changegem 'dadata'togem 'dadata-rb';require 'dadata'is unchanged (adadata-rbshim is also provided). - BREAKING: Request bodies are no longer logged by default. They contain personal data (passports, names, phones, emails); set
config.log_request_bodies = trueto restore the previous debug behavior. - BREAKING: Timeouts now raise
Dadata::TimeoutErrorinstead ofDadata::ConnectionError.TimeoutErrorsubclassesConnectionError, so existingrescue ConnectionErrorkeeps working. - BREAKING:
400/401/404responses now raiseBadRequestError/UnauthorizedError/NotFoundErrorinstead of genericApiError. All remain subclasses ofApiError. SecureLoggerlog lines now use the correct severity letter (E,W, …) instead of a hardcodedI- Single request-logging path via
SensitiveDataMiddleware(removed duplicate logging inClientBase) - Header/message sanitization consolidated into the shared
SensitiveDatamodule
- BREAKING:
config.connection_pool_sizeandconfig.connection_pool_timeout— these were never wired into the HTTP layer. The gem still uses persistent connections vianet-http-persistent. - BREAKING:
zeitwerkruntime dependency — it was declared but never used (loading is viarequire_relative). - RBS signatures under
sig/(were stale and shipped with the gem); will be regenerated once the API stabilizes.
- Removed a bogus
'Error'entry from the Faraday retry exception list Client#closenow works instead of raisingNoMethodError
- Personal data in request payloads is no longer written to logs unless explicitly enabled via
config.log_request_bodies
- Secure logging system with automatic filtering of sensitive data
SecureLoggerclass that extends Ruby's Logger to sanitize sensitive informationSensitiveDatamodule for handling sensitive data in logs and error messages- Connection pooling for improved performance
- New configuration options:
connection_pool_sizefor controlling concurrent connectionsconnection_pool_timeoutfor connection pool timeoutlog_levelfor setting logging verbosity- Custom logger support with automatic secure wrapping
- BREAKING: All loggers are now automatically wrapped in
SecureLogger - BREAKING: Configuration syntax changed from hash-style to method calls
- Improved HTTP connection handling with persistent connections
- Enhanced error handling with sanitized error messages
- Updated documentation with security best practices
- Automatic filtering of sensitive headers (Authorization, X-Secret, API-Key)
- Secure handling of API keys and secrets in logs
- Protection against accidental exposure of sensitive data in error messages
- Updated Ruby version requirement to >= 3.3.0
- Updated development dependencies to their latest versions
- Improved code formatting and alignment in test files
- Enhanced RuboCop configuration with additional rules and extensions
- Added warning suppression for third-party gem warnings in test suite
- Replaced OpenStruct with Struct in tests for better performance
- Fixed method redefinition warnings in generator tests
- Fixed API error handling in tests to use correct error message assertions
- Fixed connection error tests to properly test different network failure scenarios
- Fixed initializer generator tests to match actual template content
- Fixed test assertions to use proper configuration syntax
- Fixed test warnings related to Rails generator testing
- Fixed non-atomic file operations in generator tests
- Removed unnecessary access modifiers in tests
- Fixed API error handling in tests to use correct error message assertions
- Fixed connection error tests to properly test different network failure scenarios
- Fixed initializer generator tests to match actual template content
- Fixed test assertions to use proper configuration syntax
- Fixed test warnings related to Rails generator testing
- Comprehensive test suite for Rails generator
- Support for storing API keys in Rails credentials
- New generator options:
--use-credentials(default: true) for secure API key storage--timeoutfor configuring request timeout--suggestions-countfor setting default suggestions limit
- Improved documentation in generator templates
- Type definitions using RBS for all clients
- Bilingual documentation (Russian and English) in README
- Enhanced error handling in initializer templates
- Extended test coverage for initializer generator
- Replaced
httpgem withfaradayfor better HTTP handling - Improved initializer template with better code organization and error handling
- Renamed initializer template to use
.rb.ttextension for better Rails integration - Updated Rakefile to include all test files including initializer tests
- Improved code style and fixed RuboCop warnings:
- Fixed string literals in Gemfile
- Improved file operations safety in tests
- Enhanced error handling in API exceptions
- Fixed code style issues across the codebase
- Proper error classes in initializer templates
- Configuration validation in initializer templates
- Various code style issues and RuboCop warnings
- Added secure credentials storage option for API keys
- Warning messages when storing API keys directly in initializer
- Improved file operations safety in tests
- Initial release