Skip to content

Commit 60116d3

Browse files
author
awb99
committed
rest requests working with new oauth2 dep
1 parent 548a154 commit 60116d3

34 files changed

+38668
-557
lines changed

README.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,15 @@
1414

1515
# demo
1616

17-
The demo uses the extension manager from goldly to add oauth2 to goldly.
1817

1918
```
2019
cd demo
21-
clj -X:demo:npm-install
22-
clj -X:demo:compile
20+
clj -X:webly:npm-install
2321
clj -X:demo
2422
```
2523

26-
Test local user/password login: user: "demo" password: "1234"
24+
Open Browser on port 8080 and get auth tokens
2725

28-
Authorize xero/google/...
2926

30-
Then you can run the cli demos that use the access tokens:
31-
32-
```
33-
clj -X:run:rest-google
34-
clj -X:run:rest-github
35-
clj -X:run:rest-xero
36-
37-
clj -X:run:rest-woo
38-
39-
clj -X:run:rest-email
40-
41-
42-
; infer schema from rest-api-response (useful to quickly create api schema)
43-
clj -X:run:rest-schema
44-
45-
46-
```
27+
Then you can connect to nrepl port 9100 and evaluate
28+
demo/rest/*.clj

demo/deps.edn

Lines changed: 15 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,84 +3,29 @@
33
"target/webly"]
44
:deps
55
{org.clojure/clojure {:mvn/version "1.10.3"}
6-
clj-http/clj-http {:mvn/version "3.12.1"}
7-
commons-codec/commons-codec {:mvn/version "1.15"}
8-
uri/uri {:mvn/version "1.1.0"}
9-
;[clj-http "1.1.2"]
106
funes/funes {:mvn/version "0.1.0"} ; generate schema from rest response
11-
; goldly deps
12-
org.pinkgorilla/goldly {:mvn/version "0.4.621"}
13-
org.pinkgorilla/ui-tailwind {:mvn/version "0.0.5"}
14-
org.pinkgorilla/ui-repl {:mvn/version "0.0.72"}
7+
; pink-gorilla deps
8+
org.pinkgorilla/webly {:mvn/version "0.8.707"}
9+
org.pinkgorilla/ui-tailwind {:mvn/version "0.1.8"}
10+
org.pinkgorilla/ui-repl {:mvn/version "0.1.112"}
1511
org.pinkgorilla/rest {:local/root "../rest" :deps/manifest :deps}}
1612

1713
:aliases
18-
{:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
19-
:main-opts ["-m" "antq.core"]}
20-
21-
:nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}
22-
cider/cider-nrepl {:mvn/version "0.28.3"}}
23-
:main-opts ["-m" "nrepl.cmdline"]}
14+
{:webly {:exec-fn webly.app.app/webly-build
15+
:exec-args {:config ["demo-config.edn"]
16+
:profile "npm-install"}}
17+
18+
:npm-install {:exec-args {:profile "npm-install"}}
19+
:compile {:exec-args {:profile "compile"}}
2420

25-
; debugging
21+
; web
2622
:demo
2723
{:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}
2824
cider/cider-nrepl {:mvn/version "0.28.3"}}
2925
:exec-fn modular.system/start!
30-
:exec-args {:profile "jetty"
31-
:config ["webly/config.edn"
32-
"goldly/config.edn"
33-
"oauth2/config.edn" ; oauth2 endpoints
34-
"demo-config.edn"
35-
"/home/florian/repo/myLinux/myvault/goldly/oauth2-localhost.edn" ; oauth2 secrets
36-
"/home/florian/repo/myLinux/myvault/goldly/crb-email-telegram.edn" ; email and telegram secrets
37-
]
38-
:services "demo-services.edn" #_"goldly/services.edn"}}
39-
40-
:npm-install
41-
{:exec-fn goldly.app.build/goldly-build
42-
:exec-args {:profile "npm-install"}}
43-
44-
:compile
45-
{:exec-fn goldly.app.build/goldly-build
46-
:exec-args {:profile "compile2"}}
47-
48-
:run
49-
{:exec-fn modular.system/start!
50-
:exec-args {:config ["webly/config.edn"
51-
"goldly/config.edn"
52-
"oauth2/config.edn" ; oauth2 endpoints
53-
"demo-config.edn"
54-
"/home/florian/repo/myLinux/myvault/goldly/oauth2-localhost.edn" ; oauth2 secrets
55-
"/home/florian/repo/myLinux/myvault/goldly/crb-email-telegram.edn" ; email and telegram secrets
56-
]
57-
:services "demo-run.edn"
58-
:run demo/make-requests
59-
}}
60-
61-
; rest
62-
63-
:rest-xero {:exec-args {:provider :xero}}
64-
:rest-github {:exec-args {:provider :github}}
65-
:rest-google {:exec-args {:provider :google}}
66-
67-
:rest-email {:exec-args {:provider :email}}
68-
69-
:rest-woo {:exec-args {:provider :woo}}
70-
;:rest-wordpress {:exec-args {:provider :wordpress}} ; wordpress does not work
71-
72-
;:rest-pets {:exec-args {:provider :pets}} ; 2023-10-09 awb99: the heroku-app was down, so this does not work.
73-
:rest-schema {:exec-args {:provider :schema}}
74-
:rest-validate {:exec-args {:provider :validate}}
75-
:rest-paging {:exec-args {:provider :paging}}
76-
77-
78-
79-
80-
81-
82-
83-
84-
26+
:exec-args {:profile "watch"
27+
:config [; oauth2 secrets
28+
"/home/florian/repo/myLinux/myvault/goldly/oauth2-localhost.edn" ]
29+
:services "demo-services.edn"}}
8530
;
8631
}}

demo/resources/calendar.edn

Lines changed: 1856 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)