From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wOFBMPGgIGS1QQAASxT56A (envelope-from ) for ; Sun, 26 Mar 2023 21:45:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6H4EMPGgIGTexQAAauVa8A (envelope-from ) for ; Sun, 26 Mar 2023 21:45:53 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D12342E0F for ; Sun, 26 Mar 2023 21:45:53 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgWIc-00030h-7T; Sun, 26 Mar 2023 15:45:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgWIa-0002zl-JL for guix-patches@gnu.org; Sun, 26 Mar 2023 15:45:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgWIa-00080e-A2 for guix-patches@gnu.org; Sun, 26 Mar 2023 15:45:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgWIa-0004oL-3X for guix-patches@gnu.org; Sun, 26 Mar 2023 15:45:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60838] [PATCH v3 5/9] gnu: Add python-asgi-csrf. Resent-From: Felix Gruber Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Mar 2023 19:45:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60838 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60838@debbugs.gnu.org, Maxim Cournoyer Cc: Felix Gruber Received: via spool by 60838-submit@debbugs.gnu.org id=B60838.167985986318361 (code B ref 60838); Sun, 26 Mar 2023 19:45:04 +0000 Received: (at 60838) by debbugs.gnu.org; 26 Mar 2023 19:44:23 +0000 Received: from localhost ([127.0.0.1]:45887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgWHu-0004lx-GK for submit@debbugs.gnu.org; Sun, 26 Mar 2023 15:44:22 -0400 Received: from mout02.posteo.de ([185.67.36.66]:60405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgWHm-0004ks-I6 for 60838@debbugs.gnu.org; Sun, 26 Mar 2023 15:44:14 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0ED6F24012D for <60838@debbugs.gnu.org>; Sun, 26 Mar 2023 21:44:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679859849; bh=yRN5CGzZSOjDFJRBUBiK20qOyWCGnBtJuGnw/XQPzvM=; h=From:To:Cc:Subject:Date:From; b=JZWBu9JGsd4Y6ftS2ObcEIcYOt69afwHg+7h0gNByxZyArR0JEQ7oTcnvy2U/fGFw 6TuUCEJCzFxjVBJrdDfFeEAQPxtnIjvx4FbCHcXGEKd8kwBCNJG7ziZlsqz4+vm0sV ADK2wfhE2YxBS89HBggM+GBfina8HCcBYHgGu5ICqSVLcSAAb7xWvEiJUvIwR33VsQ v9Z7fBEo0wNdyb/BWOSTVFDR2pqbuXDIL99PPYWY6t2sogQO5QZPBdbeB0zIfKkApD e9lQYa+Htr09HS/x/6JIbqRdrYH473OdVjcDpOiqlxMJP7QBzHNChUuB6xL7g3wzHM NjGY9LXaO1xYA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Pl5x43KLfz6tm9; Sun, 26 Mar 2023 21:44:08 +0200 (CEST) From: Felix Gruber Date: Sun, 26 Mar 2023 19:43:31 +0000 Message-Id: <89202a9f9b00356ff0f82bbb22084b8bbd11a4e5.1679859198.git.felgru@posteo.net> In-Reply-To: References: <87lejplhxd.fsf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679859953; a=rsa-sha256; cv=none; b=pKRtztUTlBa8C/hnTe4Wy2+ItTSkrMy6sbydSk0MouVxVoIuOdZElvyO9aFmbmMTLevttV Jo+w0c6TxE2xCrLitABivnAVGtAtF8rnU8FdYPXPtC9wbeMu02jqTSYFQjhBrkYtdKKQ+L uiY2tbCRxHF+O/xXdWOIwWDNqGCR+zjyXXk0nDmOcBqBs2X+v47+M9Cnfhmjr4Rg/P1xYk jJCkZJD7I3kCIEJaqnWOmoorp9PO+rVXMLIeYv3nIp+rv85V6az4q+QcV7yLITxwplnnDE GjUoit03omw5iQoOTgt32VVf6gfWWOLzfTdG+FW1OJNfWNo72z8ERYBDOwFLgg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=JZWBu9JG; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679859953; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DXZnv/iT+1t5wLRjSIhA6oBMC/2lGCfaRx80ysn0ctQ=; b=ICKuRMAlebaVatg5ottDH2r/O+OmPvGBYQwyOyCik4wsWyluk0gGQ3IArGcc6xRGH1nr/6 OS7UL+jNN9TGu+CRziW1fFA3fNASyX05OsY2iNlDC6xGGm+CzVov9GgIJpSXIsJIqPMsk1 KmsJB0sPfRJCDKUYseWqy95ZJ01VElHqCEjtJH3LlwIsFmWk4qtQAWo3KGDzOT53je6kc9 tN8iXBHH8H6wqemG7xydGRM56cPkE7f6Pic10Vat+wqO8hM5IBqBFasOjw3cZdcw1A/L+J Wcq0N64MgkZLb9cxzOySYRyjgzhGamam9FMNuHF63YRTJD27pUv3ysgzr6NRRg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=JZWBu9JG; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 0.67 X-Spam-Score: 0.67 X-Migadu-Queue-Id: 8D12342E0F X-TUID: 9ZxJ4oeAtxg0 * gnu/packages/python-web.scm (python-asgi-csrf): New variable. --- gnu/packages/python-web.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 8e3f778919..0be4078513 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -570,6 +570,33 @@ (define-public python-asgiref WSGI. This package includes libraries for implementing ASGI servers.") (license license:bsd-3))) +(define-public python-asgi-csrf + (package + (name "python-asgi-csrf") + (version "0.9") + (source (origin + (method url-fetch) + (uri (pypi-uri "asgi-csrf" version)) + (sha256 + (base32 + "06klgxfxzjfkyjky3rkvmf2r07r7r2my53qq7g9qy6mcmvfkp7bf")))) + (build-system python-build-system) + (propagated-inputs (list python-itsdangerous python-multipart)) + (native-inputs (list python-asgi-lifespan + python-httpx + python-pytest + python-pytest-asyncio + python-pytest-cov + python-starlette)) + (home-page "https://github.com/simonw/asgi-csrf") + (synopsis "ASGI middleware for protecting against CSRF attacks") + (description "This Asynchronous Server Gateway Interface (ASGI) +middleware protects against Cross-site request forgery (CSRF) attacks. +It implements the Double Submit Cookie pattern, where a cookie is set +that is then compared to a @code{csrftoken} hidden form field or a +@code{x-csrftoken} HTTP header.") + (license license:asl2.0))) + (define-public python-asgi-lifespan (package (name "python-asgi-lifespan") -- 2.39.2