How to Enable Basic Auth and Whitelists in Traefik

How to enable HTTP basic authentication and IP whitelisting using Traefik middlewares for protection of proxied services.