Example #1
0
    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
Example #2
0
    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
Example #3
0
    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
Example #4
0
    def __call__(self, request):
        if not domain_matches(request, self.domain):
            return request

        request.headers["Authorization"] = "%s %s" % (self.scheme, self.token)
        return request
Example #5
0
    def __call__(self, request):
        if not domain_matches(request, self.domain):
            return request

        return super(BasicAuthentication, self).__call__(request)
Example #6
0
    def __call__(self, request):
        if not domain_matches(request, self.domain):
            return request

        request.headers['Authorization'] = '%s %s' % (self.scheme, self.token)
        return request
Example #7
0
    def __call__(self, request):
        if not domain_matches(request, self.domain):
            return request

        return super(BasicAuthentication, self).__call__(request)