The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Compare commits

...

1 Commits

Author SHA1 Message Date
Gergely Polonkai 9d100afe03 Start implementing Gerrit package 6 years ago
  1. 30
      gerrit/gerrit.el

30
gerrit/gerrit.el

@ -0,0 +1,30 @@
(eval-when-compile (require 'cl))
(require 'request)
(defun gerrit-json-read ()
"Gerrit puts five extra chars (\")]}'\n\")at the beginning of
each JSON response for security reasons. All this function does
is it strips those chars before calling `json-read'"
(goto-line 2)
(beginning-of-line)
(json-read))
(let ((username "epolger")
(password "EsthaiTh6Fu"))
(request
"https://gerrit.ericsson.se/a/changes/?q=status:open+owner:self"
:parser 'gerrit-json-read
:headers '(("Authorization"
(concat ("Basic "
(base64-encode-string (concat username
":"
password))))))
:success (function* (lambda (&key data &allow-other-keys)
(message "Success!")
(message "%s" data)))
:error (function* (lambda (&key error-thrown &allow-other-keys&rest _)
(message "Got error: %s" error-thrown)))
:complete (lambda (&rest _) (message "Finished!"))
:status-code '((401 . (lambda (&rest _) (message "Got 401"))))))
Loading…
Cancel
Save