def __call__(self, request): if not domain_matches(request, self.domain): return request request.headers['Authorization'] = '%s %s' % (self.scheme, self.token) print('REQUEST HEADERS', request.headers.get('Authorization', 1)) return request
def __call__(self, request): if not domain_matches(request, self.domain): return request token = "{} {}++{}".format(self.scheme, self.user, self.token) request.headers['Authorization'] = Cipher.get('token').encrypt(token) return request
def __call__(self, request): if not domain_matches(request, self.domain): return request if self.csrf_token and self.csrf_header_name is not None and (request.method not in self.safe_methods): request.headers[self.csrf_header_name] = self.csrf_token if self.csrf_cookie_name is not None: request.register_hook('response', self.store_csrf_token) return request
def __call__(self, request): if not domain_matches(request, self.domain): return request request.headers["Authorization"] = "%s %s" % (self.scheme, self.token) return request
def __call__(self, request): if not domain_matches(request, self.domain): return request return super(BasicAuthentication, self).__call__(request)
def __call__(self, request): if not domain_matches(request, self.domain): return request request.headers['Authorization'] = '%s %s' % (self.scheme, self.token) return request