stevestreza/Barista — pull request #3 by asmallteapot (2013-08-25 22:40:29+00:00)
Title: Add middleware for HTTP Basic authentication.

This is a pretty basic implementation. (Pun not intended.)

```objc
[self addGlobalMiddleware:[[BARBasicAuthentication alloc] initWithRealm:@"unicorn / rainbows" authorizationBlock:^BOOL(NSURLCredential *credential) {
BOOL authorized = YES;
authorized &= [credential.user isEqualToString:@"unicorn"];
authorized &= [credential.password isEqualToString:@"rainbows"];
return authorized;
}]];
```

I pulled in Matt Gallager’s iOS-friendly implementation of Base64 encoding/decoding for this; please let me know if there’s a better pre-10.9/iOS 7 solution you’d like to use.