From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WG4cO3alaGFDdwAAgWs5BA (envelope-from ) for ; Thu, 14 Oct 2021 23:47:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mL6aNnalaGHbVgAAbx9fmQ (envelope-from ) for ; Thu, 14 Oct 2021 21:47:34 +0000 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 75F519405 for ; Thu, 14 Oct 2021 23:47:34 +0200 (CEST) Received: from localhost ([::1]:59142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb8ZZ-0004fH-8x for larch@yhetil.org; Thu, 14 Oct 2021 17:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb8Z5-0004Uk-Hf for guix-patches@gnu.org; Thu, 14 Oct 2021 17:47:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53937) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb8Z4-0005qQ-9M for guix-patches@gnu.org; Thu, 14 Oct 2021 17:47:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mb8Z4-0005xR-76 for guix-patches@gnu.org; Thu, 14 Oct 2021 17:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51216] [PATCH 0/1] swh: Allows token from Software Heritage authentication service. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 14 Oct 2021 21:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51216 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 51216@debbugs.gnu.org Received: via spool by 51216-submit@debbugs.gnu.org id=B51216.163424801822879 (code B ref 51216); Thu, 14 Oct 2021 21:47:02 +0000 Received: (at 51216) by debbugs.gnu.org; 14 Oct 2021 21:46:58 +0000 Received: from localhost ([127.0.0.1]:37250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb8Yz-0005ws-I8 for submit@debbugs.gnu.org; Thu, 14 Oct 2021 17:46:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mb8Yw-0005vz-D9 for 51216@debbugs.gnu.org; Thu, 14 Oct 2021 17:46:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35818) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb8Yq-0005fR-S9; Thu, 14 Oct 2021 17:46:49 -0400 Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60508 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb8Yq-0005Dj-Aj; Thu, 14 Oct 2021 17:46:48 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211014213238.3270613-1-zimon.toutoune@gmail.com> <20211014213346.3270670-1-zimon.toutoune@gmail.com> Date: Thu, 14 Oct 2021 23:46:46 +0200 In-Reply-To: <20211014213346.3270670-1-zimon.toutoune@gmail.com> (zimoun's message of "Thu, 14 Oct 2021 23:33:46 +0200") Message-ID: <87o87rl1o9.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634248054; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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; bh=wrSew3kGowXCCPEtpefygCW8D157RATq9XRgnPxpQv4=; b=BoqkAF7BSbcS5tE3VFT+x3VAXgLQ7zpXu2p2WSPPxEPXNp0Z5gxhfPh9xnWa4bAr7ohTAI haExqa8cPJjve0acc4M55LA5aTyS5tJxZKrU1S6voZBCEYxvRQMSZcNPvZh0XrUoEvZycy HOPIgMGzE2+pK1zEvGSFi3Y1Zl0uOrZt6zyZD6A/zZrLFJbV0QXgJAJCaIQ8Y6OL5uDH63 jeMeoUec/QZpTwu2pSKq9j0H/wX6VUUpcOGvxpXMWqh8uijba5Wh1rvu7N+yXmY/+EUIbi StCIaAycTqaoE9NhV9zKq5dq+Y/8tpF1ITfKZN3+WR6Pq7LTjypBfrCs4TVcGA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634248054; a=rsa-sha256; cv=none; b=Y2uCkPuVUasdEJkx4hn/hfVsVLU8dX3Wzv+LLsU5jN+YtVrCdjOAo7PAJfvh2S9A5ZS3vN PoWHqXACYKMCM9Yy8wb2B/W1A40mNXmv3vLf2uj0LL38Lf2m1ysM6mc1aDOOXM0KCXjvGV AiYXre3VzZbbFu8uWUOMEVJIyejkBRiy46kRQRPQ/oUD4MAi0fJSxZZzQOrW4tc7zyfXuv ebMA3TQ6lclTOsBblZ4EyWMCoJ2eFFl+sgN5H3UUm4j1YyaQyrQcNprO3RIJxuEfSMNZbj xEkFIAaTAS2VxwUsB13nTK0jFiOitmdeUqoJoDg6SUMBQ8dtY3/Op7N93PrF4w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 75F519405 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: hlXN5g1DHGZz zimoun skribis: > The token is provided using the environment variable GUIX_SWH_TOKEN. > > * guix/swh.scm (swh-token): New variable. > (http-get*, http-post*): Use it. [...] > +;; Token from an account to the Software Heritage Authentication service > +;; > +(define swh-token > + (match (getenv "GUIX_SWH_TOKEN") > + (#f #f) > + ((? string-null? s) #f) > + ((? string? s) (string->symbol s)))) Could you turn it into a SRFI-39 parameter? > ;; XXX: Work around a bug in Guile 3.0.2 where #:verify-certificate? wou= ld > ;; be ignored (). > (define* (http-get* uri #:rest rest) > - (apply http-request uri #:method 'GET rest)) > + (apply http-request uri #:method 'GET > + #:headers > + (if swh-token > + `((authorization . (Bearer ,swh-token))) > + '()) > + rest)) > (define* (http-post* uri #:rest rest) > - (apply http-request uri #:method 'POST rest)) > + (apply http-request uri #:method 'POST > + #:headers > + (if swh-token > + `((authorization . (Bearer ,swh-token))) > + '()) > + rest)) These two procedures are meant to go away as soon as Guile > 3.0.2 is required. Could you instead pass #:headers in the =E2=80=98call=E2=80=99 procedure, a= nd maybe in =E2=80=98vault-fetch=E2=80=99 too? Thanks! Ludo=E2=80=99.