From nobody Thu Sep 19 00:54:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1531369315410992.7034592420663; Wed, 11 Jul 2018 21:21:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5232C804E3; Thu, 12 Jul 2018 04:21:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C4895C6C2; Thu, 12 Jul 2018 04:21:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2BE1218037EC; Thu, 12 Jul 2018 04:21:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6C4Lqpa019990 for ; Thu, 12 Jul 2018 00:21:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4E74308BDB0; Thu, 12 Jul 2018 04:21:52 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AC358308BDAE for ; Thu, 12 Jul 2018 04:21:49 +0000 (UTC) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D955308FB9A for ; Thu, 12 Jul 2018 04:21:38 +0000 (UTC) Received: by mail-pf0-f196.google.com with SMTP id l123-v6so19774352pfl.13 for ; Wed, 11 Jul 2018 21:21:38 -0700 (PDT) Received: from localhost.localdomain ([112.196.135.182]) by smtp.gmail.com with ESMTPSA id i12-v6sm31294658pgd.87.2018.07.11.21.21.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jul 2018 21:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f4Xy4+eNkIVvUAaWtgdIONCZmY+4cnbRGaw0jbNjWW0=; b=dGabnTLEbrSlQ2gWU/SvGazE0HXmS7rw3f6wiRRpljhKNg7ULgzRwxYbHnRbgnC0j5 ohDonkMAMySAjqnT2zMfG6Kg/WWI8v7Rcd0YndpBhf7un/5y5uT1svPzvykeiJaVC2J0 9UDds0FedBy6tdWCtmpU6rYjVknt5C9cUpq8cPq73UFluxTnX7vN9RG8mC5opZCVrreN UyaYwA6JcFLr8K8Sl3mGfGc8uF+MQb9Fk5SLwRB7pxXBHpsu8HowJXO5udhu41a5oyrB A1fIONEHpiXXT3pFX67T9CgwHi9Xw46LpXNHsnYQ7e/Q3lqfcI1NkTjgkmFtXjOaxZxn XTWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f4Xy4+eNkIVvUAaWtgdIONCZmY+4cnbRGaw0jbNjWW0=; b=tOuj2PCbz+uROzwxanyTXjBOUlFcZ/apuoXSV+yfjtrvYN7MxGn/1vhttAXWOknzs4 WKLlINo/TpXF/S127Xik5wiCmZFdKnLfvV5LYKO4z1LppMWQYFVTJCyqila3U1ZWm2wl jjBfs6L6p2jdpr7sA2crA/1gwClnIFet7Oyyk0AgwB5n4Lfz5Mhe56qiX4dFaKZeQSB3 eMk6OeEVr5m8aixpiGgzdxoPxE/vdJXdSrZH/8rOfuqHeqsNP9uBBw+KrrBnkzCeNTDo 38BYHdkqREtQBovkfdJRijM4REdXtYfzq9VSjUMwmMKGKNBzCA8r0o5U56uu4fPMQ48Q wA1g== X-Gm-Message-State: AOUpUlFhHaRLYFoChoC6cOX+IpU5l+I/pImd6SuXr7EUn0zlbIO/nBNR tx9Ilai41I15Uc+yuDwhwrowoQ== X-Google-Smtp-Source: AAOMgpcFraeBX77KiIDD1qMZxPhOfxoe4SiJGk2HeMHrPmxucx7XG2ZGc2Jz9APe+Wip54VXs9pXPw== X-Received: by 2002:a65:6455:: with SMTP id s21-v6mr602610pgv.394.1531369297751; Wed, 11 Jul 2018 21:21:37 -0700 (PDT) From: Shubham Jain To: patchew-devel@redhat.com Date: Thu, 12 Jul 2018 09:51:15 +0530 Message-Id: <20180712042120.2831-2-shubhamjain7495@gmail.com> In-Reply-To: <20180712042120.2831-1-shubhamjain7495@gmail.com> References: <20180712042120.2831-1-shubhamjain7495@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 12 Jul 2018 04:21:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 12 Jul 2018 04:21:38 +0000 (UTC) for IP:'209.85.192.196' DOMAIN:'mail-pf0-f196.google.com' HELO:'mail-pf0-f196.google.com' FROM:'shubhamjain7495@gmail.com' RCPT:'' X-RedHat-Spam-Score: 3.05 *** (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_WEB, SPF_PASS, T_DKIM_INVALID) 209.85.192.196 mail-pf0-f196.google.com 209.85.192.196 mail-pf0-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: patchew-devel@redhat.com Cc: Shubham Jain Subject: [Patchew-devel] [PATCH v5 1/6] Handling cookies to use REST api X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 12 Jul 2018 04:21:54 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" - Disabled CSRF authentication until OAuth authentication, since DRF leads = to csrf error while handling sessionauthentication. --- api/rest.py | 6 ++++++ patchew-cli | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/rest.py b/api/rest.py index 9ec0ae8..45dab6e 100644 --- a/api/rest.py +++ b/api/rest.py @@ -25,6 +25,12 @@ from rest_framework.response import Response import rest_framework from mbox import addr_db_to_rest, MboxMessage from rest_framework.parsers import JSONParser, BaseParser +from rest_framework.authentication import SessionAuthentication + +class CsrfExemptSessionAuthentication(SessionAuthentication): + + def enforce_csrf(self, request): + return # To not perform the csrf check previously happening =20 SEARCH_PARAM =3D 'q' =20 diff --git a/patchew-cli b/patchew-cli index 174d1e6..9e1fd22 100755 --- a/patchew-cli +++ b/patchew-cli @@ -91,7 +91,7 @@ class SubCommand(object): else: r =3D None return r - + =20 def do(self, args, argv): """Do command""" print("Not implemented") --=20 2.15.1 (Apple Git-101) _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel