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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
opengrok-restful.el
|
|
@ -40,6 +40,7 @@ |
|
|
(setq opengrok-restful-source-directory "") |
|
|
(setq opengrok-restful-source-directory "") |
|
|
(setq opengrok-restful-buffer "*opengrok-restful*") |
|
|
(setq opengrok-restful-buffer "*opengrok-restful*") |
|
|
(setq opengrok-restful-url "http://127.0.0.1:8080/api/v1/search") |
|
|
(setq opengrok-restful-url "http://127.0.0.1:8080/api/v1/search") |
|
|
|
|
|
(setq opengrok-restful-token "") |
|
|
|
|
|
|
|
|
(setq opengrok-restful-highlights |
|
|
(setq opengrok-restful-highlights |
|
|
'(("/.+:[0-9]+" . font-lock-constant-face))) |
|
|
'(("/.+:[0-9]+" . font-lock-constant-face))) |
|
|
@ -106,6 +107,7 @@ |
|
|
(request opengrok-restful-url |
|
|
(request opengrok-restful-url |
|
|
:type "GET" |
|
|
:type "GET" |
|
|
:params request-params |
|
|
:params request-params |
|
|
|
|
|
:headers (list (cons "Authorization" (format "Bearer %s" opengrok-restful-token))) |
|
|
:parser 'json-read |
|
|
:parser 'json-read |
|
|
:sync t |
|
|
:sync t |
|
|
:complete (cl-function (lambda (&key data &allow-other-keys) |
|
|
:complete (cl-function (lambda (&key data &allow-other-keys) |
|
|
|