diff options
author | Teddy Wing | 2022-05-08 00:23:34 +0200 |
---|---|---|
committer | Teddy Wing | 2022-05-08 00:28:54 +0200 |
commit | 8b2a0beca97552808a4a8c55308a0fd93af27375 (patch) | |
tree | 73025349877489b621927db166fd35878db19c2c /src/main.lisp | |
parent | 9553c53d0064da9d1c5c1af303746f17efeb4f71 (diff) | |
download | wajir-8b2a0beca97552808a4a8c55308a0fd93af27375.tar.bz2 |
Move configuration into a `config` object
We can later make a config from command line arguments.
Also don't require "https://" prefix from endpoint config. Doesn't make
sense to require that in the input when we can add it in the program.
Diffstat (limited to 'src/main.lisp')
-rw-r--r-- | src/main.lisp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main.lisp b/src/main.lisp index 094bb41..c441207 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -7,17 +7,25 @@ ;; Send email to ^maildir^program^ containing message with issue metadata ;; Continue to next page - (let ((basic-auth-token (cl-base64:string-to-base64-string - (format nil "~A:~A" "name@example.com" "atlassian-token")))) + (let* ((config (make-instance 'config + :login "name@example.com" + :token "atlassian-token" + :endpoint "example.atlassian.net" + :jql "project = \"FAKE\" AND watcher != currentUser() AND key > \"FAKE-100\" ORDER BY created DESC")) + (basic-auth-token (cl-base64:string-to-base64-string + (format nil + "~A:~A" + (login config) + (token config))))) (fetch-issues - "https://example.atlassian.net" - "project = \\\"FAKE\\\" AND watcher != currentUser() AND key > \\\"FAKE-100\\\" ORDER BY created DESC" + (endpoint config) + (jql config) :basic-auth-token basic-auth-token))) (defun fetch-issues (endpoint jql &key basic-auth-token) (jzon:parse - (dex:post (format nil "~A/rest/api/3/search" endpoint) + (dex:post (format nil "https://~A/rest/api/3/search" endpoint) :content (jzon:stringify `((:jql . ,jql) |