Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add admin contact ident type validation #2748

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

OlegPhenomenon
Copy link
Contributor

  • 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.

- 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.
Add migration to create new settings for admin contacts validation:
- admin_contacts_required_for_org: boolean setting to require admin contacts for organizations
- admin_contacts_required_for_minors: boolean setting to require admin contacts for minors
- admin_contacts_allowed_ident_type: array setting to specify allowed identification types for admin contacts

The migration safely handles existing settings by checking for their presence before creation.
Default values are set to maintain backwards compatibility while enforcing new validation rules.
- 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.
@vohmar
Copy link
Contributor

vohmar commented Feb 5, 2025

fix error message: "Admin contacts are required" replace with "Admin contact is required"

noticed two different error messages for the same error: on domain create:
"Administrative contact with identification type 'org' is not allowed"
on domain update:
"Admin contact can be private person only"

- 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.
@vohmar vohmar merged commit c4bbad9 into master Feb 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants