WHAT IT DOES / THE PROBLEM IT SOLVES

Real-time domain availability checking inside Drupal. It queries every configured TLD in one parallel sweep through a chain of pluggable providers — an authoritative HTTP API, RDAP, WHOIS, and a DNS fallback — tried per TLD in priority order. Results are strictly three-state (available / registered / unknown): availability is never guessed, so "unknown" is returned rather than a false answer when no provider can respond. It also ships an optional domain registration-request workflow (content entity, status lifecycle, admin listing, private-file certificate upload, mail notifications).

Providers are extensible via a tagged-service interface, so a new protocol is a new tagged service with no change to existing code.

AUTOMATED REVIEW

- Coder / phpcs (Drupal + DrupalPractice): 0 errors, 0 warnings (php, module, install, inc, yml, twig, css, js).
- PHPStan (phpstan-drupal) level 4: clean, with only documented, justified baseline exceptions.
- PHPUnit: full Unit + Kernel + Functional suite green on both Drupal 10.3 (PHPUnit 9.6) and Drupal 11 (PHPUnit 11.5), no new deprecations.

MANUAL REVIEW NOTES

- All service access is via dependency injection; no \Drupal:: static calls in business logic, and no error suppression with the @ operator.
- User input is validated and never trusted; the JSON endpoint and public routes are rate-limited and permission-gated; the provider API key is write-only in the settings form and never rendered back.
- A stable release (1.0.1) is published; commits on the 1.0.x branch are my own.

DEPENDENCY

This project depends on saudi_id_validator (https://www.drupal.org/project/saudi_id_validator), also my project and published on Drupal.org — all Saudi ID validation is delegated to it by design; no ID-validation logic is duplicated here.

Project link

https://www.drupal.org/project/domain_availability

Comments

abdelwahied created an issue. See original summary.

abdelwahied’s picture

Review bonus

As part of the review-bonus program, I have reviewed these three applications:

- https://www.drupal.org/project/projectapplications/issues/3611786 (Smart 404)
- https://www.drupal.org/project/projectapplications/issues/3611460 (Protected Pages Extra)
- https://www.drupal.org/project/projectapplications/issues/3608209 (Simple Parallax JS)

vishal.kadam’s picture

Title: [D10][D11] Domain Availability » [1.0.x] Domain Availability
Issue summary: View changes
avpaderno’s picture

Thank you for applying!

Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: domain_availability.module

A new module that aims to be compatible with latest Drupal releases is expected to implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.

2. FILE: src/Entity/DomainRegistrationRequest.php

Projects that are compatible with Drupal 10 or higher versions should use attributes instead of annotations.

3. FILE: src/Form/RegistrationSettingsForm.php, src/Form/SettingsForm.php

With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.

    $form['image_toolkit'] = [
      '#type' => 'radios',
      '#title' => $this->t('Select an image processing toolkit'),
      '#config_target' => 'system.image:toolkit',
      '#options' => [],
    ];

Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.

abdelwahied’s picture

All three points are addressed.

1. Hooks as class methods — FIXED

hook_help(), hook_theme(), hook_mail() and hook_preprocess_HOOK() are now #[Hook] methods on classes in src/Hook/, alongside the existing hook_runtime_requirements() implementation. hook_mail() takes the date formatter and translator by injection rather than calling \Drupal::service().

The module supports ^10.3 || ^11, and Drupal 10.3 dispatches no object-oriented hooks: core/lib/Drupal/Core/Hook/HookCollectorPass.php does not exist on 10.3.x, and core's own Hook attribute there states it "will not have an effect until Drupal 11.1.0". Each procedural function therefore remains as a thin delegate marked #[LegacyHook], which HookCollectorPass skips wherever that attribute is present.

Verified that only the class implementation runs on 11.1+, with no HookCollectorPass deprecation notices.

2. Attributes instead of annotations on the entity — NOT CHANGED, reasoning below

Attribute-based entity discovery arrived in Drupal 11.1, not 11.0:

- core/lib/Drupal/Core/Entity/Attribute/ContentEntityType.php — absent on 10.3.x and 11.0.x, present from 11.1.0.
- EntityTypeManager::__construct() uses new AnnotatedClassDiscovery('Entity', $namespaces, 'Drupal\Core\Entity\Annotation\EntityType') on 10.3.x and 11.0.x, and new AttributeDiscoveryWithAnnotations($this->subdir, $this->namespaces, EntityType::class, 'Drupal\Core\Entity\Annotation\EntityType') from 11.1.0.

An attributes-only entity is therefore not discovered on Drupal 10.3 or 11.0, both inside the declared ^10.3 || ^11. The class carries the #[ContentEntityType] attribute and a matching @ContentEntityType annotation.

Carrying both emits no deprecation on any version in that range: 10.3 and 11.0 discover annotations without deprecating them, 11.1 does not deprecate annotation discovery, and from 11.2 AttributeDiscoveryWithAnnotations::parseClass() parses the attribute first and returns before the annotation branch is reached.

The annotation will remain while the module supports Drupal versions that require annotation-based entity discovery. It can be removed once the minimum supported Drupal version no longer requires annotation-based entity discovery.

3. #config_target — FIXED

Both settings forms declare their configuration with #config_target, and RegistrationSettingsForm::submitForm() is removed entirely. Transformed values — the TLD lists, trimmed strings, the two fallbacks — carry their conversion in a ConfigTarget.

Two values in SettingsForm keep manual handling:

- pricing is assembled from every registered pricing strategy, including ones not currently selected, so it is not a single element's value; its mode radio keeps #default_value.
- saudinic_api_key is write-only. Under #config_target, ConfigFormBase::loadDefaultValuesFromConfig() sets #default_value from the stored value, which would render the key into the page.

#config_target and ConfigTarget both exist on 10.3.x, so the supported range is unchanged.

All tests pass, and PHPCS (Drupal and DrupalPractice) is clean.

abdelwahied’s picture

Status: Needs work » Needs review
abdelwahied’s picture

Title: [1.0.x] Domain Availability » [1.2.x] Domain Availability

The three points from #5 are now pushed and visible on the 1.2.x branch:

- Hooks implemented as class methods in src/Hook/ using #[Hook], with #[LegacyHook] procedural counterparts retained for Drupal 10.3, where OOP hook discovery is unavailable. The classes are registered explicitly in domain_availability.services.yml so classResolver() hands the same configured object to the procedural delegates on 10.3; the two never both run.
- Entity definitions retain annotations alongside attributes: attribute-based entity discovery arrived in Drupal 11.1, and this module supports ^10.3 || ^11.
- #config_target now declares configuration on both settings forms. Two values remain handled manually and are documented inline: the pricing table assembly, and the write-only API key, where a blank submission means keep the stored key rather than clear it.

CI passes on Drupal ~10.3.0 (PHP 8.3), Drupal ^11 (PHP 8.3) and Drupal ^11 (PHP 8.5). PHPCS (Drupal + DrupalPractice) is clean on the changed files.

I've also updated the issue title to the branch that carries this work. Apologies for the earlier confusion — my previous comment described these changes before they were actually pushed.