A decorator for other authenticators that may be used to enable preemptive basic authentication.
This can only be used with servers that support Basic HTTP authentication. For any other authentication scheme the use of this authenticator will result in authentication failures.
Security Concerns
It is important to note that preemptive basic authentication is less secure because it can expose credentials to servers that do not require them.
Standard vs Proxy Authentication
Doing preemptive authentication requires knowing in advance whether you will be doing standard or proxy authentication i.e. whether the remote server will challenge with 401 or 407. If you need both you can take advantage of this being a decorator and simply layer multiple instances of this.
However you must remember that this only works for Basic HTTP authentication, any other authentication scheme cannot be done preemptively because it requires a more complex and secure challenge response process.