- Split IP validation logic for IPv4 and IPv6 addresses
- Add specific validation for IPv6 to allow only single addresses (/128) or /64 ranges
- Remove old network address calculation for IPv6
- Keep IPv4 address limit validation unchanged
- Add localization for new IPv6 validation error message
- Add test coverage for IPv6 validation:
* Test for valid /64 range
* Test for valid single address
* Test for invalid ranges (/48 and /96)
- Add AgeValidation module for consistent age checks
- Validate admin contacts must be at least 18 years old
- Move age validation logic from Domain to shared module
- Add tests for admin contact age validation
- Fix JSON format for admin_contacts_allowed_ident_type setting
This change ensures that administrative contacts must be adults (18+),
using the same age validation logic as for registrants. The validation
works with both birthday and Estonian ID formats. Settings are now
properly stored as JSON strings for consistent parsing.
This commit updates the email validation pattern in Truemail configuration to better handle various email format edge cases. The changes include:
Refine email regex pattern in config/initializers/truemail.rb to properly validate:
RFC compliant local parts with allowed special characters
Proper domain name formatting
Prevention of consecutive dots in both local part and domain
Leading and trailing dots in local part
Add comprehensive test cases in test/interactions/email_check_test.rb to verify:
Valid email formats like standard addresses, underscore usage, and dot-atom formats
Invalid email formats including consecutive dots, leading/trailing dots, and invalid characters
These changes ensure our email validation is more RFC-compliant while still being strict enough to catch common errors. The test suite now explicitly validates both positive and negative test cases for email format validation.
This commit addresses several issues with the ProcessClientHold class and its tests:
1. Changed notification text in notify_client_hold method from 'force_delete_set_on_domain'
to 'hold_client_on_domain' to better reflect the actual action being performed.
Added corresponding translation key in locales/en.yml.
2. Fixed the test_send_mail_delivers_email test by using stub method instead of
redefining DomainDeleteMailer.forced, which was causing conflicts with other tests.
This ensures that tests are isolated and don't affect each other.
3. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
to properly stub the force_delete_scheduled? method.
4. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
including notification creation and client hold status setting.
5. Added proper error handling in tests to ensure methods don't raise exceptions.
The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars with
appropriate messages, and sends emails when required.
This commit addresses several issues with the ProcessClientHold class and its tests:
1. Fixed the test_send_mail_delivers_email test by properly mocking the
DomainDeleteMailer.forced method with correct parameter signatures
and adding template_name to the domain.
2. Updated all tests to use Domain.stub_any_instance(:force_delete_scheduled?, true)
to properly stub the force_delete_scheduled? method.
3. Improved test assertions to ensure proper behavior of the ProcessClientHold class,
including notification creation and client hold status setting.
4. Added proper error handling in tests to ensure methods don't raise exceptions
and restore original method implementations after testing.
The changes ensure that the ProcessClientHold class correctly handles client hold
status for domains in the force delete process, properly notifies registrars,
and sends emails when required.
This commit implements a reliable connection error handling solution for the
Company Register API integration. The job previously failed when connection
errors occurred without proper recovery mechanisms.
The implementation:
Adds a lightweight Retryable module with configurable retry logic
Implements smart caching of API responses (1 day expiration)
Handles common network errors like KeepAliveDisconnected and timeouts
Provides a fallback mechanism when all retry attempts fail
Ensures test reliability with cache-skipping in test environment
Testing:
Added specific tests for both recovery and fallback scenarios
Verified cache behavior in production and test environments
Resolves connection errors observed in production logs without adding
unnecessary complexity to the codebase.
Update `force_delete_start_date` method to handle cases where `domain.force_delete_start` is not present:
- Return formatted current date plus expire warning period if `force_delete_start` is missing
- Ensure consistent date formatting across scenarios
This change prevents errors when `force_delete_start` is nil and provides a fallback date based on the current date and configured warning period.
- Add force delete type and start date to notifications
- Extract company status notes logic into separate method
- Standardize status message formatting for both soft and fast track deletes
- Update translation templates to include force delete type and start date info
- Add Estonian translation for new notification fields
- Add flag in force_delete_data to track manual client_hold removal
- Update ProcessClientHold to respect manual status removal
- Add test to verify client_hold doesn't return after admin removes it
When an admin manually removes the client_hold status from a domain,
it should not be automatically re-added by the ProcessClientHold job.
This change tracks manual removals and prevents the status from being
re-added while maintaining the force delete process.
- Update error message for missing admin contact to be more concise
- Standardize admin contact validation message for invalid ident type
- Remove redundant error message formatting
The changes make admin contact validation messages more consistent
throughout the application, using "Admin contact" terminology instead
of "Administrative contact" for better clarity and consistency.
fix: improve company register status messages
- Update error message for missing company in registry
- Clarify status message format for existing companies
- Update dependencies: logger (1.6.5) and net-smtp (0.5.1)
The changes make company status messages more descriptive and clearer
for administrators when a company's registration status triggers domain
deletion. Messages now explicitly state whether a contact was not found
or has a specific status in the business registry.
- Change error code from 2004 to 2306 for admin contact validation
- Add explicit validation check for required admin contacts
- Update tests to expect new error code
The error code 2306 better reflects the EPP standard for policy-based
validation failures. This change makes the error handling more consistent
with EPP specifications when validating admin contact requirements.