(self, req)
| 994 | return None |
| 995 | |
| 996 | def http_request(self, req): |
| 997 | if (not hasattr(self.passwd, 'is_authenticated') or |
| 998 | not self.passwd.is_authenticated(req.full_url)): |
| 999 | return req |
| 1000 | |
| 1001 | if not req.has_header('Authorization'): |
| 1002 | user, passwd = self.passwd.find_user_password(None, req.full_url) |
| 1003 | credentials = '{0}:{1}'.format(user, passwd).encode() |
| 1004 | auth_str = base64.standard_b64encode(credentials).decode() |
| 1005 | req.add_unredirected_header('Authorization', |
| 1006 | 'Basic {}'.format(auth_str.strip())) |
| 1007 | return req |
| 1008 | |
| 1009 | def http_response(self, req, response): |
| 1010 | if hasattr(self.passwd, 'is_authenticated'): |
nothing calls this directly
no test coverage detected