github tokens being deprecated

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Matt Wette
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Matt Wette
Severity
normal
M
M
Matt Wette wrote on 8 Feb 2020 15:50
(address . bug-guix@gnu.org)
b9548ed0-f38b-64cc-961b-fa01f006d36f@gmail.com
$ guix refresh
...
Backtrace:
          12 (apply-smob/1 #<catch-closure 7f0c2c0c66c0>)
In ice-9/boot-9.scm:
    705:2 11 (call-with-prompt _ _ #<procedure default-prompt-handle?>)
In ice-9/eval.scm:
    619:8 10 (_ #(#(#<directory (guile-user) 7f0c2bd4e140>)))
In guix/ui.scm:
  1808:12  9 (run-guix-command _ . _)
In ice-9/boot-9.scm:
    829:9  8 (catch _ _ #<procedure 7f0c2bcbd3b8 at guix/ui.scm:652?> ?)
    829:9  7 (catch _ _ #<procedure 7f0c2bcbd3d0 at guix/ui.scm:775?> ?)
In guix/store.scm:
   625:10  6 (call-with-store _)
  1848:24  5 (run-with-store #<store-connection 256.99 7f0c1fd586c0> ?)
In guix/scripts/refresh.scm:
   541:14  4 (_ _)
In srfi/srfi-1.scm:
    640:9  3 (for-each #<procedure 7f0c2abf1d00 at guix/scripts/ref?> ?)
In guix/scripts/refresh.scm:
    344:2  2 (check-for-package-update #<package sbcl-stumpwm-with-?> ?)
In guix/import/github.scm:
   237:25  1 (latest-release #<package sbcl-stumpwm-with-slynk@19.11?>)
In unknown file:
           0 (scm-error misc-error #f "~A" ("Error downloading rel?") ?)

ERROR: In procedure scm-error:
Error downloading release information through the GitHub
API. This may be fixed by using an access token and setting the environment
variable GUIX_GITHUB_TOKEN, for instance one procured from


after github token acquired:

$ guix refresh
...
guix refresh: warning: input 'Carp' of perl-xml-compile is in Perl core
gnu/packages/xml.scm:1113:13: tinyxml2 would be upgraded from 7.0.1 to 7.1.0
following redirection to
gnu/packages/xdisorg.scm:1731:13: python-pyperclip would be upgraded
from 1.6.4 to 1.7.0


and then an email from github.com:

Hi @mwette,

On February 8th, 2020 at 14:37 (UTC) your personal access token (guix/bluefin) using GNU Guile was used as part of a query parameter to access an endpoint through the GitHub API:


Please use the Authorization HTTP header instead, as using the `access_token` query parameter is deprecated and will be removed July 1st, 2020.

Depending on your API usage, we'll be sending you this email reminder once every 3 days for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.


Thanks,
The GitHub Team
M
M
Matt Wette wrote on 15 Feb 2020 19:43
github auth
(address . 39511@debbugs.gnu.org)
bc46393e-140e-48d8-1918-2b017b7a4980@gmail.com
I have not gotten into testing, but according to email and references
provided previously the patch below might work.


--- github.scm-orig    2020-02-15 10:32:52.209481329 -0800
+++ github.scm    2020-02-15 10:40:36.958144491 -0800
@@ -154,14 +154,12 @@
     ;; Ask for version 3 of the API as suggested at
     `((Accept . "application/vnd.github.v3+json")
+      ,@(if (%github-token)
+        `(Authorization . ,(string-append "token " (%github-token)))
+        '())
       (user-agent . "GNU Guile")))

-  (define (decorate url)
-    (if (%github-token)
-        (string-append url "?access_token=" (%github-token))
-        url))
-
-  (match (json-fetch (decorate release-url) #:headers headers)
+  (match (json-fetch release-url #:headers headers)
     (#()
      ;; We got the empty list, presumably because the user didn't use
GitHub's
      ;; "release" mechanism, but hopefully they did use Git tags.
M
M
Matt Wette wrote on 16 Feb 2020 00:02
udpate
(address . 39511@debbugs.gnu.org)
a6fdf6e8-bbc4-4f60-3af9-ae89f0fb33f7@gmail.com
oops:  `(Auth ...) => (list `(Auth...))
L
L
Ludovic Courtès wrote on 22 Feb 2020 11:52
Re: bug#39511: github auth
(name . Matt Wette)(address . matt.wette@gmail.com)(address . 39511@debbugs.gnu.org)
87eeumzyfs.fsf@gnu.org
Hi Matt,

Matt Wette <matt.wette@gmail.com> skribis:

Toggle quote (3 lines)
> I have not gotten into testing, but according to email and references
> provided previously the patch below might work.

I’ve applied the patch on your behalf, thank you!

Ludo’.
M
M
Matt Wette wrote on 22 Feb 2020 15:39
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 39511@debbugs.gnu.org)
14644b73-f89c-dba0-ef24-e29532319598@gmail.com
On 2/22/20 2:52 AM, Ludovic Courtès wrote:
Toggle quote (11 lines)
> Hi Matt,
>
> Matt Wette <matt.wette@gmail.com> skribis:
>
>> I have not gotten into testing, but according to email and references
>> provided previously the patch below might work.
> I’ve applied the patch on your behalf, thank you!
>
> Ludo’.
>

much appreciated

Matt
M
M
Maxim Cournoyer wrote on 5 Oct 2020 04:56
(name . Ludovic Courtès)(address . ludo@gnu.org)
87zh51js7y.fsf@gmail.com
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (11 lines)
> Hi Matt,
>
> Matt Wette <matt.wette@gmail.com> skribis:
>
>> I have not gotten into testing, but according to email and references
>> provided previously the patch below might work.
>
> I’ve applied the patch on your behalf, thank you!
>
> Ludo’.

Closing, thanks!

Maxim
Closed
?