From nobody Thu Apr 18 02:39:39 2024 Delivered-To: importer2@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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557755597; cv=none; d=zoho.com; s=zohoarc; b=GYT7BANfi2TMpe9au4VAUunRfsQJcFs+SUiBdIJ4v9BEM4i9fp1URCAiASJ76aunR1+85EqtIL2bcu1V9Gs/w1IrPexrJJlx3Xh5nB1CYdDVVpWSt1j8aZwR9XKcpBKJf7gpW0Uaj62t+tm0b4P/WsuXBm58UFBkg2N+HIvzr6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557755597; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VdZVwXZwUIDNG+jrpTWLl3r0+1zD/E++M1vIdUORbHg=; b=V+nvVi8FzdxgN36TGXGfb2lytgPGprJs4aT+xQq+avSteD5L+YLO/afmJMizUllrcVI1R7ZIA2KIj26BlL/c55t1M7eQiftV77g25PCFTmeqogSDiTLmTvrjunfJYO3G+MjAAhyvO8ojJX19kRdTUQsxYJS0PtehJQf2mS+lUWI= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557755597577926.4875213318969; Mon, 13 May 2019 06:53:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 631073084032; Mon, 13 May 2019 13:53:16 +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 574B96A48A; Mon, 13 May 2019 13:53:16 +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 4DCE618089CC; Mon, 13 May 2019 13:53:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4DDrEve025244 for ; Mon, 13 May 2019 09:53:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3AC6118668; Mon, 13 May 2019 13:53:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3573B1823E for ; Mon, 13 May 2019 13:53:10 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 53B12883A2 for ; Mon, 13 May 2019 13:53:01 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id v11so15395044wru.5 for ; Mon, 13 May 2019 06:53:01 -0700 (PDT) Received: from localhost.localdomain ([212.140.138.203]) by smtp.gmail.com with ESMTPSA id 34sm5456970wre.32.2019.05.13.06.52.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 06:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qLQc6uj5iM+nvnxK8fKBqOI2nRh7m98itEEs3yZhmGM=; b=DSG1UKUoRBRLjst3Ifd8+/C9uuhKgk+r61F4PxMU7hBfaiX83U/RsMA7Ur7cmwWiCt r87rPyTRRpB+ACGyIPCWX96rhUZI8R9u9PMalTOY5QibKsmBHvElIRBR8+40NW7X9yGY ZWr5i3GmDq1W0gD/VgFVX/4Lrlz10OFiUwhq0b9f4E4uDhrOwOli5FNLbi/jLvjHKQTa 5jEMqqrMSKizY6rzCfP+8OBCPpufAJxPEFr4kHhEBLZstPApK7FoDm9/29uqDHr5dKkR 9fHoyeRGIBjSPIjf+RllaO+cMk+EW2fhCWPF40ysa8p1CsckhfMC4dGChB8j+HxEWitX gSqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=qLQc6uj5iM+nvnxK8fKBqOI2nRh7m98itEEs3yZhmGM=; b=Xi5Q5VoDBsqi/yN6zYgOBmrFSjh90spG6Ma6ESDNbJHMreWowBwtWym5ooIXxbZODa nf5WYoM4fVqQkHxVAtZwMDDQbge6lEFCeVQWwoGQv6YD4ZVQu8J8E3XUyp9h4QlVg8fY XkpUdE5euuh7szJilvwH7/GCe3mfKW4cSwJR7ntzyVIh0rzOqryMM5ns776zrl9mk33O IZdu2Ep11QkxF6RaphFFUr8UtvHE6FI3WVHBP56/ITmoxQJ1hkC+Tu7HhxNWGt3StNN/ mKVm3afBWhTUVb3IvAPqYykE0O+GX/gThSOzg9baQ/BHZFWmeZeAvLj6b/QWozj3n2LI 7AHw== X-Gm-Message-State: APjAAAXEJrYBfkJ9YpkNMQ5SKmP6eB3w8i1TlEd1hFMlrZk1SURyO6u9 pW1ftwXLBVIhB1yaT+WrPK+OMn4lVUk= X-Google-Smtp-Source: APXvYqyKQnw3YLqBHBousY7qimlNS0L6pWstw43KTx67KmapjseZs8Qv8Ye+8vE5N041X8EhfaYK1w== X-Received: by 2002:adf:fb09:: with SMTP id c9mr15238693wrr.137.1557755579698; Mon, 13 May 2019 06:52:59 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 13 May 2019 15:52:54 +0200 Message-Id: <20190513135256.15125-2-pbonzini@redhat.com> In-Reply-To: <20190513135256.15125-1-pbonzini@redhat.com> References: <20190513135256.15125-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 May 2019 13:53:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 May 2019 13:53:01 +0000 (UTC) for IP:'209.85.221.43' DOMAIN:'mail-wr1-f43.google.com' HELO:'mail-wr1-f43.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.002 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_PASS) 209.85.221.43 mail-wr1-f43.google.com 209.85.221.43 mail-wr1-f43.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/3] api: anchor all URLs 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 13 May 2019 13:53:16 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" --- api/urls.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/urls.py b/api/urls.py index 8977acb..f71a5e4 100644 --- a/api/urls.py +++ b/api/urls.py @@ -22,7 +22,7 @@ def _build_urls(base=3DNone, r=3D[]): if cls.name: # API views should handle the authentication explicitly, disab= le # csrf check to simplify client code - r.append(url(cls.name + "/", cls.as_view())) + r.append(url("^" + cls.name + "/", cls.as_view())) else: _build_urls(cls, r) return r @@ -49,9 +49,9 @@ results_router.register('results', rest.SeriesResultsView= Set, base_name=3D'results schema_view =3D get_schema_view(title=3D'API schema') =20 urlpatterns =3D _build_urls() + [ - url(r"v1/", include(router.urls)), - url(r"v1/", include(projects_router.urls)), - url(r"v1/", include(results_router.urls)), + url(r"^v1/", include(router.urls)), + url(r"^v1/", include(projects_router.urls)), + url(r"^v1/", include(results_router.urls)), url(r'^v1/schema/$', schema_view), # Use the base class's handler by default url(r".*", views.APIView.as_view()) --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 18 02:39:39 2024 Delivered-To: importer2@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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557755853; cv=none; d=zoho.com; s=zohoarc; b=FJ7Opv5jq4OTyZlqATnOwPAtXAjunenw90BbFr8o5stz4NqkpiR/aOEI3VznJd6TCX7+Kb4dH99q+LVEAWiuiPtMEgaMPYJYcqeOmxQ+QwE3GmRG9NQLBd2tAc8PdsB1Fgy6m4eHJsRcjzACJs99GqzEOZN6b+Q8+qyV4XQ6vVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557755853; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=LbRii/BO3klMWg3C4uEYzB/Qvcr7AHGSOfsu35wZLas=; b=HClK6SHdNxAwWc9vOgZlJeyQFrlo8sDdcHf8eLCsdUI6WhFkTdFjpyRtSk19HLiLiYssmIw3bjNbri0dsIYALURIxjTQCC8OTv60otpzC2tj1OS/SICItALcaqhFP99tGDB+WYYgQpyNnAFbClRn71RQDiZqJ3gkl0zSB5u571c= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557755853767198.75178698325192; Mon, 13 May 2019 06:57:33 -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 F32532D7EA; Mon, 13 May 2019 13:57:31 +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 E828E6928F; Mon, 13 May 2019 13:57:31 +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 DE7EF18089D3; Mon, 13 May 2019 13:57:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4DDrHTE025279 for ; Mon, 13 May 2019 09:53:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id E6FFF69292; Mon, 13 May 2019 13:53:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E169C6928F for ; Mon, 13 May 2019 13:53:15 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 558D23087945 for ; Mon, 13 May 2019 13:53:02 +0000 (UTC) Received: by mail-wr1-f51.google.com with SMTP id r7so14749232wrr.13 for ; Mon, 13 May 2019 06:53:02 -0700 (PDT) Received: from localhost.localdomain ([212.140.138.203]) by smtp.gmail.com with ESMTPSA id 34sm5456970wre.32.2019.05.13.06.52.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 06:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Jy3GnmwPf/DCC1mUkdOM0/5wsTPBgAinStFY0YUop3g=; b=S6wb9eoeu2rS6RiZ7jNU8KvnJAgvZtZs7eRPjKmuHIuYDd1w0UhHxBIgJ10XUA03v+ UhGo+n+s/bmeuIIgGTNrAAvFWqhJSgmsqBASeO66qguIbdOk4qwXYGbL9HejBSVM5K62 LuZUa+CBtvm9Xivwo9cb6pZoJflaWjoR3+a/580TgTXU0j8JzLSTSuMGsvXvpBLLGbrQ zrX7t3M/IAut1WWlcOOwoGF0xZ2KZ1Bcri01uvBWewLvtqtg+Xlysu35a7w3EiFIEbJv r0qsFX0P/hVc4B2LQi5n7TXCAqJxA2NRP/hsrt7JQpHFTAQB+nVCTcrfvqs4d6KnavRZ aTFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Jy3GnmwPf/DCC1mUkdOM0/5wsTPBgAinStFY0YUop3g=; b=PnX/rYoEIn/dvJqx6efaCXmXop17Y3Eh95Fmw6cMfz1KjOwh+dFcIxT8EJzRHGlQtF 7dQgf7bpj4WFU3QvvkIqzrV0aUuy+5dsFTMfVAAnW3WkB0ZCNP5uIYO46jn+vpdNRryk N4VDqxD/84a0HSbwQrp3Tp37KFJGxP1AzkcS+mQht/YkIZ2+LeP1e5crTUW8BgW0irwp atpQmikKQ6xOgmGhJOC0clSpU+ipTFYfdrl+TSVElI109Bz6XRKCruFLvgAFKL0sUhUT /RcFtocJabjsIxPvOegqy+fdiFNKvusrS3kyyGsaAGDTZrHscwUrfKwwtvyOOF5jRlXd PldQ== X-Gm-Message-State: APjAAAUJYxYqfPKI8TmvbarnvrhHBqlj5iWimlnebI0PwEdmDlTaheT7 GkPpbRC0/Ia8WVlxHgGZnlVvzFWIlfw= X-Google-Smtp-Source: APXvYqx7FO6CjWJiOZFVTfV/BJAbSACdvrkBen4cd40D+AgNxKk3vvr0S0VSNZejNv0cMALmyL6rKw== X-Received: by 2002:a5d:6b46:: with SMTP id x6mr814130wrw.313.1557755580742; Mon, 13 May 2019 06:53:00 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 13 May 2019 15:52:55 +0200 Message-Id: <20190513135256.15125-3-pbonzini@redhat.com> In-Reply-To: <20190513135256.15125-1-pbonzini@redhat.com> References: <20190513135256.15125-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 13 May 2019 13:53:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Mon, 13 May 2019 13:53:02 +0000 (UTC) for IP:'209.85.221.51' DOMAIN:'mail-wr1-f51.google.com' HELO:'mail-wr1-f51.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.002 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_PASS) 209.85.221.51 mail-wr1-f51.google.com 209.85.221.51 mail-wr1-f51.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 2/3] rest: enable token-based authentication 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: , 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.30]); Mon, 13 May 2019 13:57:32 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" --- patchew/settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/patchew/settings.py b/patchew/settings.py index 11a79b4..dead744 100644 --- a/patchew/settings.py +++ b/patchew/settings.py @@ -47,6 +47,7 @@ INSTALLED_APPS =3D [ 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', + 'rest_framework.authtoken', ] =20 MIDDLEWARE =3D [ @@ -62,6 +63,10 @@ MIDDLEWARE =3D [ ] =20 REST_FRAMEWORK =3D { + 'DEFAULT_AUTHENTICATION_CLASSES': ( + 'rest_framework.authentication.TokenAuthentication', + 'rest_framework.authentication.SessionAuthentication', + ), 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagin= ation', 'URL_FIELD_NAME': 'resource_uri', 'PAGE_SIZE': 50, --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel From nobody Thu Apr 18 02:39:39 2024 Delivered-To: importer2@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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557755597; cv=none; d=zoho.com; s=zohoarc; b=f0kleWarPqpFNkFFVnFql54RIyfRyNHZUfWPcaTfLhI46VqKfh54ENzCLj2HJoyutvDvdjKrSyrEPCTms0s1Ytmz5EZYUchxUFOvgHVv1QNwBdOAEXR6GLzGWUClorIHloZd4hKuvNaQp6ot0XB6DRtgawVv01YK8WdAULU1oYo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557755597; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ApoXHJVY+W5k9Zn0V4Fj1FTprxhSdewvHCdqS5Vl0Us=; b=FL5RjnxhylL1fjiaDod3NF1Be3UPiQbb4i3ArT5DtDKVlaeVqreYKttguROEIhtBu6voCr4tTuXDhriDDjv19JI5Rf85wqLq+xrJeQQ7jKw2wtsBXYGX+5gOk0FjtbhDMxcA5iPyX7dKvg4fYonNjL4m8lLuZNTKUOSQr1rXFJ8= ARC-Authentication-Results: i=1; mx.zoho.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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557755597641182.8599193176267; Mon, 13 May 2019 06:53:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 792B9307D868; Mon, 13 May 2019 13:53:16 +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 6DCCA19C6F; Mon, 13 May 2019 13:53:16 +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 65C3318089CC; Mon, 13 May 2019 13:53:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4DDrEXK025255 for ; Mon, 13 May 2019 09:53:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id C88C919C67; Mon, 13 May 2019 13:53:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C32F419C72 for ; Mon, 13 May 2019 13:53:14 +0000 (UTC) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 5646D5F79C for ; Mon, 13 May 2019 13:53:03 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id f2so13814180wmj.3 for ; Mon, 13 May 2019 06:53:03 -0700 (PDT) Received: from localhost.localdomain ([212.140.138.203]) by smtp.gmail.com with ESMTPSA id 34sm5456970wre.32.2019.05.13.06.53.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 06:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nCAFDvlon1Mk/YdwJ40taWyeIMvK9wydtjB7QRZbvoc=; b=Fhv4A3i0kYKCWoTChK8Ip/gEav6Bv3ikVxJiqgPPkg6cCGKEORa1TsJNo/Yr7ABEhF MLAmhEMFL5EKUrgvCQ0n6ZYoUTXXtRnM++0xJcqhtb/DbwJPIVTbxAzSMh3HShRjii8l v2NGowE7V3oKRRfQthLSswsyxjCxyYnrmgHaQZj5Fb7wTb/Hm+uEiI75R1jnyAXk3713 yUZFRjgk0f8/Otyw++xDA3PqxwmfhOVBHnSxj7pbKPA8nUEgbVI0svKcR34vshK4NIQk t0P/044Lf3SHyJ8BZCx0e92VE07TJ5idktpQATIKz5dycRKQC2i3YsjHCtBN5AH1y1/H GRYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nCAFDvlon1Mk/YdwJ40taWyeIMvK9wydtjB7QRZbvoc=; b=TlClYQn6kYaS3TzO1PlFTkjX3S8nAZ/Zmf7Cluvj1LIhhPHHL+7IugYKtq2TAm/cdC nC3y+5PuceN9carJLJGDSLIijm/dbuKs4sRtpVHI7qnYscG4WBwf7skIT0F7GkTXg+ED OMUPIVX5NoOeVTSifQ6Yax4n3GyjcUtSsDwfOnkp9UuY7jV0l5vsRcs/XOVbGEBskYmP pamLwEVQrxyJ7jvwdwrl5Vw99fuzhD9VqqGEZ3edFpeZo3UBZrj8Kvtgocu0QVhE7ncN /AO8qvKgZkiMfNPRdqEmEgLejAkPhATqT+EVnRjMy+HUNEWls7fxZgxwo9+yCZ9diaUk BV0g== X-Gm-Message-State: APjAAAWoPVRyIIlwOVfY6al3twFf/J7m6Dl5eNgcSoL9oGhfJHfhWL6r C8hEW+IjpDhHZDgXABDS5qRCiJdLp9Y= X-Google-Smtp-Source: APXvYqzZSR/Y/lfk1jYmm20Fvc1642vYRBb9IjDr4N26pETdZWW1DA5KkqnhOneDcluXke9RKZoXXQ== X-Received: by 2002:a1c:eb18:: with SMTP id j24mr16593173wmh.32.1557755581699; Mon, 13 May 2019 06:53:01 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 13 May 2019 15:52:56 +0200 Message-Id: <20190513135256.15125-4-pbonzini@redhat.com> In-Reply-To: <20190513135256.15125-1-pbonzini@redhat.com> References: <20190513135256.15125-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 May 2019 13:53:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 13 May 2019 13:53:03 +0000 (UTC) for IP:'209.85.128.50' DOMAIN:'mail-wm1-f50.google.com' HELO:'mail-wm1-f50.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.002 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_PASS) 209.85.128.50 mail-wm1-f50.google.com 209.85.128.50 mail-wm1-f50.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 3/3] rest: add rest_auth support 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: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 13 May 2019 13:53:16 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This adds API endpoints /api/v1/users/{login,logout}/ that can be used to obtain an authentication token. --- api/urls.py | 4 ++++ patchew/settings.py | 1 + requirements.txt | 1 + 3 files changed, 6 insertions(+) diff --git a/api/urls.py b/api/urls.py index f71a5e4..b1e259f 100644 --- a/api/urls.py +++ b/api/urls.py @@ -8,6 +8,8 @@ # This work is licensed under the MIT License. Please see the LICENSE fil= e or # http://opensource.org/licenses/MIT. =20 +from rest_auth.views import LoginView, LogoutView + from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from rest_framework_nested.routers import NestedDefaultRouter @@ -49,6 +51,8 @@ results_router.register('results', rest.SeriesResultsView= Set, base_name=3D'results schema_view =3D get_schema_view(title=3D'API schema') =20 urlpatterns =3D _build_urls() + [ + url(r'^v1/users/login/$', LoginView.as_view(), name=3D'rest_login'), + url(r'^v1/users/logout/$', LogoutView.as_view(), name=3D'rest_logout'), url(r"^v1/", include(router.urls)), url(r"^v1/", include(projects_router.urls)), url(r"^v1/", include(results_router.urls)), diff --git a/patchew/settings.py b/patchew/settings.py index dead744..4e10b44 100644 --- a/patchew/settings.py +++ b/patchew/settings.py @@ -46,6 +46,7 @@ INSTALLED_APPS =3D [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'rest_auth', 'rest_framework', 'rest_framework.authtoken', ] diff --git a/requirements.txt b/requirements.txt index 59c9480..a03dbe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ gunicorn>=3D19 djangorestframework>=3D3.0.0 jsonfield2 >=3D 3.0, < 4.0 drf-nested-routers +django-rest-auth>=3D0.9.0 coreapi-cli pyyaml psycopg2 --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel