Skip to content

Commit 084ce85

Browse files
author
Luigi Zuccarelli
authored
Merge pull request #8 from microlib/ACL-7-JWT-Service
Initial POC of JWT token create
2 parents bf00521 + 5bb041a commit 084ce85

64 files changed

Lines changed: 3093 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
classes
2+
logs
3+
file.list
4+
.vscode
5+

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ACL info
2+
3+
## Environment
4+
5+
Ensure JDK 1.8.0 or later is installed
6+
7+
## Generate RSA signing files via shell:
8+
9+
A key pair for each service should be generated and stored in a secure unique directory (for each key pair).
10+
11+
```
12+
$ openssl genrsa -out private_key.pem 2048
13+
$ openssl pkcs8 -topk8 -inform PEM -outform DER -in private_key.pem -out private_key.der -nocrypt
14+
$ openssl rsa -in private_key.pem -pubout -outform DER -out public_key.der
15+
16+
```
17+
18+
## Compile
19+
20+
```
21+
./make.sh clean
22+
./make.sh compile
23+
24+
```
25+
26+
## Launch the server
27+
28+
```
29+
./make.sh run
30+
31+
```
32+
33+
## Testing using curl
34+
35+
The folder test-keystore is used for testing and should not be used for any production environments
36+
37+
```
38+
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"controller":"com.microlib.controller.JwtService" , "action":"getToken"}' http://localhost:9000
39+
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"controller":"com.microlib.controller.JwtService" , "action":"createAndSignToken", "key-id":"test-keystore"}' http://localhost:9000
40+
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"controller":"com.microlib.controller.JwtService" , "action":"verifyToken", "key-id":"test-keystore" , "token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJhdXRoMCJ9.gF-JDds389H5l4tk2o7qpuSIzSAEgjfVwTb7c3Tf1InuD7EWk5gjY4kKPP__MGc39HfOobjqUMsUFAJBAJYOJxKmfLMBCLr5TXMMeLcc3-qZw3NZ0DDhq76yLiVA_P3pBm1k-kKtZQvwRY8VrLN9JfBm0BDy3f2wvNRmDXQLHAU33fi4zACpGcTJ9TfNBoY84sOGUBhd73yxPLr4lBhYrFjcqGboZDNzg2LdisTVP1I_9KlHA4d8-H5LHYOcwiFD-hFZteKl52jslKfNucHgrhn0D1iLf4YiE92yNVobLAkVN_qPG8ZX8sNlA5AahIqKenk6hK_C0f1LTGzc6ZxXMA"}' http://localhost:9000
41+
42+
```
43+
44+
## Improvements
45+
46+
Read all key pairs into memory at server startup

conf/scheduler.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{ "jobs" : [{
2+
"name" : "FxAlert",
3+
"class" : "com.lmzsoftware.service.V8JavaBridgeImpl",
4+
"script" : "scripts/rates.js",
5+
"params" : "",
6+
"crontab" : "0 0/2 8-20 ? * 1-7",
7+
"enabled" : false
8+
},{
9+
"name" : "MusicRipper",
10+
"class" : "com.lmzsoftware.service.V8JavaBridgeImpl",
11+
"script" : "scripts/media.js",
12+
"params" : "",
13+
"crontab" : "0 15 22 ? * 1-7",
14+
"enabled" : false
15+
}]
16+
}
17+

lib/bcprov-jdk15on-1.56.jar

3.29 MB
Binary file not shown.

lib/commons-codec-1.10.jar

278 KB
Binary file not shown.

lib/commons-codec-1.3.jar

45.6 KB
Binary file not shown.

lib/commons-collections-3.1.jar

546 KB
Binary file not shown.

lib/commons-logging-1.1.1.jar

59.4 KB
Binary file not shown.
25.9 KB
Binary file not shown.

lib/commons-net-ftp-2.0.jar

89 KB
Binary file not shown.

0 commit comments

Comments
 (0)