Commit graph

11382 commits

Author SHA1 Message Date
oleghasjanov
3b594cf30d fix tests 2025-04-16 11:47:52 +03:00
oleghasjanov
0fe20bd63b Fixed Certificate#update_crl test to properly verify CRL updater script call
The test for Certificate.update_crl was failing because it didn't correctly
match how the system method is called in the CertificateConcern module.
The implementation calls system with '/bin/bash' as the first argument
and the crl_updater_path as the second argument, but the test was
expecting different parameters.

- Simplified the test_update_crl_should_call_crl_updater_script test to
  directly verify the script path is used without trying to intercept
  the system call
- Added proper environment variable handling for crl_updater_path
- Ensured original method is restored after test execution
2025-04-16 11:47:52 +03:00
oleghasjanov
5355397025 feat: improve certificate download extensions
Update certificate download functionality to use appropriate file extensions:
- Use .p12 extension for PKCS#12 files
- Keep .pem extension for PEM-encoded files (CSR, CRT, private key)

This change ensures that downloaded certificate files have the correct extension based on their format, making it easier for users to identify and use the files correctly.
2025-04-16 11:47:52 +03:00
oleghasjanov
51035d1ddf Add UserCertificate model with tests
- Create UserCertificate model with validations and certificate renewal logic
- Add tests for UserCertificate model functionality
- Add user certificates fixtures for testing
- Add association between ApiUser and UserCertificates
- Add required gems: dry-types, dry-struct, openssl
- Add /certs to .gitignore

This commit implements the base model for storing user certificates in the
database, including private keys, CSRs, certificates and P12 files. The model
includes basic validation and certificate renewal functionality, with
comprehensive test coverage.
2025-04-16 11:47:50 +03:00
Timo Võhmar
c192d3bf08
Update CHANGELOG.md 2025-04-07 14:28:32 +03:00
Timo Võhmar
1dc3396391
Merge pull request #2774 from internetee/daily-force-delete-and-lift-email-subscribe
feat: Add lifted force delete domains to daily admin notification
2025-04-07 14:27:08 +03:00
oleghasjanov
8234a0fe68 updated styles 2025-04-04 14:14:58 +03:00
Timo Võhmar
220b26f0ce
Merge pull request #2777 from internetee/add-dockerfile-production
Added Dockerfile for production and updated gemfile
2025-04-03 11:44:13 +03:00
Timo Võhmar
59213ede5f
Update CHANGELOG.md 2025-04-02 12:59:18 +03:00
Timo Võhmar
32215c9c1f
Merge pull request #2775 from internetee/turn-off-company-validaiton
feat: add ability to skip business contact validation
2025-04-02 12:57:53 +03:00
tsoganov
94e8d928db Added Dockerfile for production and updated gemfile 2025-04-02 12:46:54 +03:00
oleghasjanov
bfecc3c40e refactor: improve force delete domain status tracking
- Add force_delete_domain_statuses_history_data to store force delete metadata
- Update force delete queries to use new JSON status history
- Refactor force delete tests to use travel_to helper
- Remove direct force_delete_start field usage
- Update status notes to include company identification number
2025-04-01 13:52:43 +03:00
oleghasjanov
f542ad036b added breakline 2025-04-01 12:34:03 +03:00
oleghasjanov
c77a4d494d feat: add ability to skip business contact validation
- Add environment variable 'allow_validate_business_contacts' to control business contact validation
- Remove redundant company_is_relevant? method
- Add integration test for skipping company validation
2025-04-01 12:26:53 +03:00
Timo Võhmar
ebc9fd4871
Update CHANGELOG.md 2025-03-31 16:58:27 +03:00
Timo Võhmar
05210ddbba
Merge pull request #2764 from internetee/2747-multiple-underscores-in-email-addresses
# Improve email validation regex pattern and add comprehensive tests
2025-03-31 16:56:23 +03:00
oleghasjanov
917e426d91 feat: Add lifted force delete domains to daily admin notification
- Add tracking of lifted force delete domains with reason and date in json_statuses_history
- Modify ForceDeleteDailyAdminNotifierJob to include both force deleted and lifted domains
- Update admin mailer template to show separate tables for force deleted and lifted domains
- Update tests to reflect new functionality and fix timing issues with yesterday's data

Key changes:
- Store lift reason and date when canceling force delete
- Add new query method for finding lifted force delete domains
- Split email template into two sections
- Fix tests to properly handle the yesterday time window
2025-03-31 16:07:04 +03:00
Timo Võhmar
bcc178388d
Update CHANGELOG.md 2025-03-28 14:27:46 +02:00
Timo Võhmar
8d33bd5de0
Merge pull request #2771 from internetee/ipv6-whitelist-support
feat: support IPv6 /64 range in white IP validation
2025-03-28 14:25:33 +02:00
oleghasjanov
8ccfaef699 fixed integration test 2025-03-24 15:43:06 +02:00
oleghasjanov
bc01dfaa3a feat: support IPv6 /64 range in white IP validation
- 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)
2025-03-24 15:16:10 +02:00
Timo Võhmar
7ae4ebda53
Update CHANGELOG.md 2025-03-24 14:14:44 +02:00
Timo Võhmar
5946afc729
Merge pull request #2770 from internetee/2750-admin-contact-cannot-be-a-minor-clean
2750 admin contact cannot be a minor clean
2025-03-24 14:13:26 +02:00
oleghasjanov
98f0bb283e fix path to localize issue 2025-03-21 13:45:07 +02:00
oleghasjanov
58a1dbafb0 rollback 2025-03-21 12:42:18 +02:00
oleghasjanov
4b1d29944f fixed another one failed system test 2025-03-21 12:33:57 +02:00
oleghasjanov
7ef22c6894 fix system test 2025-03-21 12:24:20 +02:00
oleghasjanov
f79f32fb5d added condition for underage 2025-03-21 12:09:47 +02:00
oleghasjanov
9fa14c0c07 added condition 2025-03-20 16:45:25 +02:00
oleghasjanov
e6cb30b599 added check 2025-03-20 16:39:20 +02:00
oleghasjanov
7799727867 feat: add age validation for admin contacts
- 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.
2025-03-20 16:37:38 +02:00
oleghasjanov
66619f12fe Add certs directory to gitignore 2025-03-20 16:30:33 +02:00
oleghasjanov
b67e8bc18f Remove sensitive certificates from repository 2025-03-20 16:30:07 +02:00
Timo Võhmar
2be9ce28ae
Update CHANGELOG.md 2025-03-20 16:14:27 +02:00
Timo Võhmar
39af1f75a1
Merge pull request #2768 from internetee/2594-fix-update-disputed-domains
Modified validate dispute case
2025-03-20 16:12:01 +02:00
tsoganov
10738995b6 Updated integration test 2025-03-18 16:58:48 +02:00
tsoganov
d10f3d3b2c Modified validate dispute case 2025-03-18 16:34:03 +02:00
tsoganov
ad05aa0d36 Updated verify registrant change 2025-03-18 16:12:47 +02:00
tsoganov
c2881acdca Updated verify registrant change 2025-03-18 16:09:24 +02:00
oleghasjanov
54aefe4a2c update regex 2025-03-10 15:13:09 +02:00
oleghasjanov
f866b549b5 # Improve email validation regex pattern and add comprehensive tests
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.
2025-03-10 14:24:02 +02:00
Timo Võhmar
1fbfdff1e7
Update CHANGELOG.md 2025-03-07 16:09:30 +02:00
Timo Võhmar
9db844a12c
Merge pull request #2763 from internetee/missing-reason-in-notification
Fix ProcessClientHold notification and added tests
2025-03-07 16:05:37 +02:00
Timo Võhmar
696a077f98
Merge pull request #2762 from internetee/http-timeout-phone-validation
Http timeout phone validation
2025-03-07 16:04:32 +02:00
oleghasjanov
95a6403595 Fix ProcessClientHold tests and implementation
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.
2025-03-06 15:32:39 +02:00
oleghasjanov
29c6c8ff44 Fix ProcessClientHold tests and implementation
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.
2025-03-06 15:18:16 +02:00
oleghasjanov
ea8fa01f9b refactor 2025-03-06 11:51:01 +02:00
oleghasjanov
a11c0fca2d fix: handle HTTPClient::KeepAliveDisconnected in OrgRegistrantPhoneCheckerJob
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.
2025-03-06 11:38:09 +02:00
oleghasjanov
832ebff533 added files to gitignore 2025-03-06 10:50:00 +02:00
Timo Võhmar
464d56910e
Update CHANGELOG.md 2025-02-21 11:04:04 +02:00