Commit graph

1878 commits

Author SHA1 Message Date
oleghasjanov
1aa470727a refactoring 2025-04-22 11:18:18 +03:00
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
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
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
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
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
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
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
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
be5bba09fb Refactor force delete notifications and improve status handling
- 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
2025-02-17 12:31:51 +02:00
Timo Võhmar
38dc5466e9
Merge pull request #2723 from internetee/company-validator-during-creation
feat: restore company validation for Estonian organizations
2025-02-12 10:33:28 +02:00
oleghasjanov
2d103bda99 fix: improve admin contact validation messages
- 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.
2025-02-05 11:53:56 +02:00
oleghasjanov
19611fe429 updated logs sidekiq handling 2025-02-03 14:08:50 +02:00
oleghasjanov
2ec545b3aa feat: add status notes to force delete notifications
- Add notes parameter to force delete interactions to provide more context
- Include company registry status in force delete notifications
- Add status mapping constants for better readability
- Move status note assignment before save in force delete process

Technical details:
- Add notes field to Domains::ForceDelete::Base interaction
- Update force delete notifications to include status notes
- Add REGISTRY_STATUSES mapping in CompanyRegisterStatusJob
- Update tests to verify new notification format
2025-02-03 14:08:50 +02:00
oleghasjanov
f2978599b4 feat: add admin contact ident type validation
- Add new setting for allowed admin contact ident types
- Add validation for admin contact ident types on domain create/update
- Add UI controls for managing allowed ident types
- Add tests for new validation rules
- Update domain model to respect new settings

The changes allow configuring which identification types (private person,
organization, birthday) are allowed for administrative contacts. This is
enforced when creating new domains or adding new admin contacts.
2025-02-03 13:59:03 +02:00
tsoganov
55848e1000 Added birthday ident verification 2025-01-27 16:26:20 +02:00
Timo Võhmar
8dcc287d60
Merge pull request #2737 from internetee/improve-verification-translations
Improved verification email translations
2025-01-15 16:45:44 +02:00
tsoganov
03f2ab0463 Improved verification email translations 2025-01-14 15:31:53 +02:00
oleghasjanov
6facbc8302 updated poll message 2024-12-19 11:15:23 +02:00
oleghasjanov
b229613b8a feat: Add invalid ident notification for company register status checks
- Add notification system for invalid company identifications
- Update force delete notifications to handle invalid company cases
- Add translations for invalid ident messages (ET/EN)
- Add test coverage for invalid ident scenarios
- Remove debug logging from force delete process
- Clean up unused CSV templates

This change improves handling of invalid company identifications in the
Estonian business registry by providing proper notifications to registrars
and ensuring appropriate status updates.
2024-12-17 14:08:57 +02:00
tsoganov
0085f99e02 Modified identification request webhook 2024-11-14 08:37:09 +02:00
tsoganov
285fa138e6 Fixed codeclimate 2024-11-14 08:37:09 +02:00
tsoganov
637cabf95f Handling contact verifications 2024-11-14 08:37:09 +02:00
oleghasjanov
468e9e829f added sleep delay flag 2024-11-08 12:46:17 +02:00
oleghasjanov
44958c79bb added sleep delay configurable 2024-11-08 12:46:17 +02:00
oleghasjanov
6ff5e55a24 business contact validation + tests 2024-11-08 12:45:12 +02:00
tsoganov
c7d3788a36 Updated contact name data type in schemas 2024-08-22 11:25:54 +03:00
Sergei Tsoganov
d150c1bc3d Modified registrar ip restriction 2023-08-04 11:59:40 +03:00
Sergei Tsoganov
e00e44c9b8 Modified white ip form and created mailer 2023-07-05 15:28:43 +03:00
Sergei Tsoganov
e13caf2518 Fixed transaltions 2023-07-04 11:48:49 +03:00
Sergei Tsoganov
61c59cb4b2 Fixed transaltions 2023-07-04 11:45:53 +03:00
Sergei Tsoganov
97c11f5dfd Added error messages translations to white ips 2023-07-04 11:33:06 +03:00
Sergei Tsoganov
72507e80a7 Updated tests 2023-06-29 13:22:04 +03:00
Sergei Tsoganov
66a8ea111f Updated tests 2023-06-29 13:01:57 +03:00
Sergei Tsoganov
47b6a1b87a Added endpoints for creating and downloading api user certificates 2023-06-28 15:48:40 +03:00
Sergei Tsoganov
b558c80e83 Added user certificate REPP endpoint and mailer 2023-06-09 17:05:22 +03:00
Sergei Tsoganov
ded8917adf Added ip whitelist max count and validation 2023-05-31 14:51:40 +03:00
Sergei Tsoganov
b44c757602 Added white ip show page 2023-05-30 15:49:56 +03:00
Sergei Tsoganov
18cd6f5046 Added validation for one only IP 2023-05-30 14:42:56 +03:00
Sergei Tsoganov
b84e9e1579 Added ApiUser and WhiteIp endpoints to REPP API 2023-05-29 14:26:53 +03:00
Sergei Tsoganov
0f16ec77f5 Added csv export to registrar api_users and white_ips 2023-05-15 14:11:46 +03:00
Timo Võhmar
da514f9a50
Merge pull request #2531 from internetee/68-creating-syncronization-of-invoice-changes
creating sync with billing
2023-04-20 16:08:47 +03:00
Sergei Tsoganov
edc4162f71 Corrected test errors 2023-03-16 12:32:02 +02:00
Sergei Tsoganov
c67430d652 Allowed to have dot in contact routes 2023-02-06 16:12:57 +02:00
olegphenomenon
0a4444b556 creating sync with billing 2023-02-06 10:44:17 +02:00