Skip to content

Commit f630a69

Browse files
authored
Updated nonce usage to chat removal (#1189)
1 parent 5c81fb7 commit f630a69

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

DSL/Ruuter.private/DSL/GET/cron-tasks/delete-conversations.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,49 @@ declaration:
1111
- field: isAuth
1212
type: boolean
1313
description: "Body field 'isAuth'"
14+
headers:
15+
- field: x-ruuter-nonce
16+
type: string
17+
description: "Nonce field"
1418

1519
assignValue:
1620
assign:
1721
isAuth: ${incoming.params.isAuth}
1822

23+
getNewNonce:
24+
call: http.post
25+
args:
26+
url: "[#CHATBOT_RESQL]/get-new-nonce"
27+
result: newNonce
28+
1929
backupConversations:
2030
call: http.post
2131
args:
2232
url: "[#CHATBOT_RUUTER_PRIVATE]/chats/back-up-removable-chats"
33+
headers:
34+
x-ruuter-nonce: ${newNonce.response.body[0].nonce}
2335
body:
2436
isAuth: ${isAuth}
2537
result: chats
2638

2739
validateResponse:
2840
switch:
2941
- condition: ${chats.response.body.response.length > 0}
30-
next: emptyMessages
42+
next: getNewNonceToEmpty
3143
next: return_not_found
3244

45+
getNewNonceToEmpty:
46+
call: http.post
47+
args:
48+
url: "[#CHATBOT_RESQL]/get-new-nonce"
49+
result: newNonceToEmpty
50+
3351
emptyMessages:
3452
call: http.post
3553
args:
3654
url: "[#CHATBOT_RUUTER_PRIVATE]/chats/empty-conversations-by-chat-ids"
55+
headers:
56+
x-ruuter-nonce: ${newNonceToEmpty.response.body[0].nonce}
3757
body:
3858
chatIds: ${chats.response.body.response}
3959
result: res

DSL/Ruuter.private/DSL/POST/chats/back-up-removable-chats.yml

+12
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@ declaration:
1111
- field: isAuth
1212
type: boolean
1313
description: "Body field 'isAuth'"
14+
headers:
15+
- field: x-ruuter-nonce
16+
type: string
17+
description: "Nonce field"
18+
19+
getNewNonce:
20+
call: http.post
21+
args:
22+
url: "[#CHATBOT_RESQL]/get-new-nonce"
23+
result: newNonce
1424

1525
getRemovableConversations:
1626
call: http.post
1727
args:
1828
url: "[#CHATBOT_RUUTER_PRIVATE]/chats/chat-to-remove"
29+
headers:
30+
x-ruuter-nonce: ${newNonce.response.body[0].nonce}
1931
body:
2032
isAuth: ${incoming.body.isAuth}
2133
result: res

DSL/Ruuter.private/DSL/POST/chats/chat-to-remove.yml

+12
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,23 @@ declaration:
1111
- field: isAuth
1212
type: boolean
1313
description: "Body field 'isAuth'"
14+
headers:
15+
- field: x-ruuter-nonce
16+
type: string
17+
description: "Nonce field"
18+
19+
getNewNonce:
20+
call: http.post
21+
args:
22+
url: "[#CHATBOT_RESQL]/get-new-nonce"
23+
result: newNonce
1424

1525
getConfigurations:
1626
call: http.get
1727
args:
1828
url: "[#CHATBOT_RUUTER_PRIVATE_INTERNAL]/configs/delete-conversation-config?skipAuth=true"
29+
headers:
30+
x-ruuter-nonce: ${newNonce.response.body[0].nonce}
1931
result: configs
2032

2133
splitCall:

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ services:
4848
- application.logging.printStackTrace=true
4949
- application.internalRequests.disabled=true
5050
- server.port=8088
51-
- application.externalAuthAllowed=/cron-tasks/delete-conversations
51+
- application.externalAuthAllowed=/cron-tasks/delete-conversations,chats/back-up-removable-chats,chats/chat-to-remove,chats/empty-conversations-by-chat-ids
5252
volumes:
5353
- ./DSL/Ruuter.private/DSL:/DSL
5454
- ./constants.ini:/app/constants.ini

0 commit comments

Comments
 (0)