Drupal 8 uses Composer for package dependencies and autoloading classes based on PSR standards. This allows us to use any available PHP library much more easily than in previous versions of Drupal.
In this recipe, we will add the IpRestrict Stack Middleware library to add the functionality to whitelist access to the Drupal site based on allowed IP addresses.