From patchwork Mon Nov 23 17:24:41 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5777 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id tl9-n1csp3102373lad; Mon, 23 Nov 2026 09:25:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEg7T4f6aI3tO69QHF+0ZdN79pEKFd/+buPM8H9tl92vUeb6i0pBGlqqEoHobW4NzoKWTuB+IcFfiE=@openvpn.net X-Received: by 2002:a05:7301:6184:20b0:386:b006:c8 with SMTP id 5a478bee46e88-386b0060806mr3853283eec.35.1795454700406; Mon, 23 Nov 2026 09:25:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795454700; cv=none; d=google.com; s=arc-20260327; b=XjZf6oYP6rEdmcngf+a0/rIAfvAjN778l9bL9gbdmEScV/gp7A8thTU9Jc+VlfI6h4 bN88AtXpKV811UxdjuTGOGSMIMEjfUCM2JM95dyDLumiP+7WCPR+mtGX2cNL5Nn9EN7T Lqq3Zyn+TH0WKiu62G2hCzHFTGINUoRB72+7LPKCKWY+jlCHJROcNpkzoV0qpdG9nh9h 7wCqnj9R4Vb45D1/SqGRqgrqndeh2KHyjlujjwymmujYFi2ss7chmqoYA92tjrQ0zq7Q spjv5Vm5L0FMM2iwB6wAp7VbBqsb4lQHVyltwlNfLZqpXXn3jLrMNzrgXPObvTE9WsTq tmjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=gTSF0f7BuvKBT/yJWugO1iqgdEtDHBraVNzjU9t90fg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=JeYw0z2l1Pp/G1x3IN9LxXN+V6Gb0qddJRev39cT3sfENYxfEogzDn6DazTa3uUL8d LnI6qxshJCMqspcZW1ZbJGj/Rtu58obFG4pL5dg7WqUKYnn5blCta3xPLiK5QNxxZuYM Vq3G6S9oGb7LA1yYF2q11RFgpN5gVxyZq3BE/0GInS2kP2NldzHpXBT6iWpMY5clWJvw 1MTVDtaS3qt6hBRXoUVXLMzmseIKEN1bVDxpYpLkTE/jl8ylbGtfggbDHPVrqn+GH1WW +biYylwdIsXv2emFYvgedMzlJT9am3tQvdrhcPiim6SdAVuyccIepCaF1zqzjvC5H+wy A9PA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=RMEUcJ+E; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=lzSNXKde; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WYnTMhGv; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5a478bee46e88-38566fd6cffsi49808567eec.22.2026.11.23.09.25.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Nov 2026 09:25:00 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=RMEUcJ+E; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=lzSNXKde; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=WYnTMhGv; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=gTSF0f7BuvKBT/yJWugO1iqgdEtDHBraVNzjU9t90fg=; b=RMEUcJ+E+gJ0f2 ySO5oa9DiY/we+zWhr75+Toq47a/pPaajVDaSnI3mSFdzp3NXzhnj7fdRCoDzkZg43bJffk5qbxLK eHQYbKWyFJYdg2H5t3qYP1mLSpcMjMyeVj8Mmjw/duDRKpQ/bIZlcbuBZkb1P69o1X4wCC1HyasJj Mjo=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xVXml-000000000Pk-1AoI; Mon, 23 Nov 2026 17:24:59 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xVXmh-000000000Ou-2sOR for openvpn-devel@lists.sourceforge.net; Mon, 23 Nov 2026 17:24:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=3dLQt9Gh9TtavsHdi6qGCPleF6nuvhgh/gXXdranD70=; b=lzSNXKdeC8KlF1sx0jbjHGjcPL 4ycJfvHjxXd/aC4FLZSLGX8ElbgbbjWPDvIuAQCnuHq7vgalyO4DFzfD8xLm1hNvINoGg6SHB/LOj QMsa9BFyFbk1fTGMCCJv1nXSRatbn5v9LlV7mFco0ZRyKpNvY25BmHp1TfjgTK2xE97s=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3dLQt9Gh9TtavsHdi6qGCPleF6nuvhgh/gXXdranD70=; b=WYnTMhGvuln3OKVEircGMCRjcz e80kGBEUQ9MlyRdC+xjbwI93/O+q+ZsFSHfRVZeNYR+uEdkEJyPMUL73Hhr+lW6EHOHyMH21vANcL aMO5dSciceXhUlLxvVfprxD/YsuNfEN6dvyf+CSy2cmbxZLAFtUWdmKi2ubdL2M1cmdE=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xVXmf-000000001bc-3ToR for openvpn-devel@lists.sourceforge.net; Mon, 23 Nov 2026 17:24:55 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6ANHOluI022134 for ; Mon, 23 Nov 2026 18:24:47 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6ANHOlYD022133 for openvpn-devel@lists.sourceforge.net; Mon, 23 Nov 2026 18:24:47 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 23 Nov 2026 18:24:41 +0100 Message-ID: <20261123172446.22118-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-1.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld Required for changes in private projects. Change-Id: I00b340f30dc3518994b74c49565736524b7df318 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xVXmf-000000001bc-3ToR Subject: [Openvpn-devel] [PATCH v2] gerrit-send-mail: Support user authentication X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1882670707545810885 X-GMAIL-MSGID: 1882670707545810885 From: Frank Lichtenheld Required for changes in private projects. Change-Id: I00b340f30dc3518994b74c49565736524b7df318 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2195 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2195 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py index ae904d5..d6e78a9 100755 --- a/dev-tools/gerrit-send-mail.py +++ b/dev-tools/gerrit-send-mail.py @@ -18,10 +18,18 @@ # Extract a patch from Gerrit and transform it in a file suitable as input # for git send-email. +# Note: This generally works without authentication since it only reads +# information and doesn't change any state in Gerrit itself. +# To access changes in projects that are not viewable by anonymous +# visitors set GERRIT_USER and GERRIT_PASS environment variables. +# GERRIT_PASS can be a token as generated on your user settings page +# under "HTTP Credentials". + import argparse import base64 from datetime import timezone import json +import os import sys from urllib.parse import urlparse @@ -29,9 +37,11 @@ import requests -def get_details(args): +def get_details(args, gerrit_api_url, auth): params = {"o": ["CURRENT_REVISION", "LABELS", "DETAILED_ACCOUNTS"]} - r = requests.get(f"{args.url}/changes/{args.changeid}", params=params) + r = requests.get( + f"{gerrit_api_url}/changes/{args.changeid}", params=params, auth=auth + ) print(r.url) json_txt = r.text.removeprefix(")]}'\n") json_data = json.loads(json_txt) @@ -76,9 +86,10 @@ } -def get_patch(details, args): +def get_patch(details, args, gerrit_api_url, auth): r = requests.get( - f"{args.url}/changes/{args.changeid}/revisions/{details['revision']}/patch?download" + f"{gerrit_api_url}/changes/{args.changeid}/revisions/{details['revision']}/patch?download", + auth=auth, ) print(r.url) patch_text = base64.b64decode(r.text).decode() @@ -138,8 +149,16 @@ parser.add_argument("-u", "--url", default="https://gerrit.openvpn.net") args = parser.parse_args() - details = get_details(args) - patch = get_patch(details, args) + auth = None + gerrit_api_url = args.url + if "GERRIT_USER" in os.environ: + gerrit_user = os.environ["GERRIT_USER"] + gerrit_pass = os.environ["GERRIT_PASS"] + auth = requests.auth.HTTPBasicAuth(gerrit_user, gerrit_pass) + gerrit_api_url += "/a" + + details = get_details(args, gerrit_api_url, auth) + patch = get_patch(details, args, gerrit_api_url, auth) apply_patch_mods(patch, details, args)