Browse Source

add authorization support (#1)

opengrok restful api need token to support remote access

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
main
hitmoon 2 years ago
committed by GitHub
parent
commit
8d8aa7bf8b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      opengrok-restful.el

2
opengrok-restful.el

@ -40,6 +40,7 @@
(setq opengrok-restful-source-directory "")
(setq opengrok-restful-buffer "*opengrok-restful*")
(setq opengrok-restful-url "http://127.0.0.1:8080/api/v1/search")
(setq opengrok-restful-token "")
(setq opengrok-restful-highlights
'(("/.+:[0-9]+" . font-lock-constant-face)))
@ -106,6 +107,7 @@
(request opengrok-restful-url
:type "GET"
:params request-params
:headers (list (cons "Authorization" (format "Bearer %s" opengrok-restful-token)))
:parser 'json-read
:sync t
:complete (cl-function (lambda (&key data &allow-other-keys)

Loading…
Cancel
Save