Skip to content

Commit 3459610

Browse files
committed
[jwt] introduce jwt package
1 parent a54a588 commit 3459610

File tree

16 files changed

+1796
-6
lines changed

16 files changed

+1796
-6
lines changed

api/mobile.http

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Authorization: Bearer {{mobileToken}}
6868
Content-Type: application/json
6969

7070
{
71-
"currentPassword": "wsmgz1akhoo24o",
72-
"newPassword": "wsmgz1akhoo24o"
71+
"currentPassword": "8f8ijpnuvemq7y",
72+
"newPassword": "8f8ijpnuvemq7y"
7373
}
7474

7575
###

api/requests.http

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@baseUrl={{$dotenv CLOUD__URL}}
22
@credentials={{$dotenv CLOUD__CREDENTIALS}}
33
@mobileToken={{$dotenv MOBILE__TOKEN}}
4+
@jwtToken={{$dotenv JWT__TOKEN}}
45
@phone={{$dotenv PHONE}}
56

67
###
@@ -34,7 +35,8 @@ Authorization: Basic {{credentials}}
3435
###
3536
POST {{baseUrl}}/3rdparty/v1/messages HTTP/1.1
3637
Content-Type: application/json
37-
Authorization: Basic {{credentials}}
38+
# Authorization: Basic {{credentials}}
39+
Authorization: Bearer {{jwtToken}}
3840

3941
{
4042
"textMessage": {
@@ -78,11 +80,13 @@ Authorization: Basic {{credentials}}
7880

7981
###
8082
GET {{baseUrl}}/3rdparty/v1/messages/Fc10ZyTRDVlqPjIm9Jbly HTTP/1.1
81-
Authorization: Basic {{credentials}}
83+
# Authorization: Basic {{credentials}}
84+
Authorization: Bearer {{jwtToken}}
8285

8386
###
8487
GET {{baseUrl}}/3rdparty/v1/messages HTTP/1.1
85-
Authorization: Basic {{credentials}}
88+
# Authorization: Basic {{credentials}}
89+
Authorization: Bearer {{jwtToken}}
8690

8791
###
8892
GET {{baseUrl}}/3rdparty/v1/messages?from=2025-01-01T00:00:00.000Z&to=2025-12-31T23:59:59Z&state=Pending&deviceId=fL2m4IirEvh9BvTf6TIB0&limit=50&offset=0 HTTP/1.1
@@ -101,7 +105,9 @@ Content-Type: application/json
101105

102106
###
103107
GET {{baseUrl}}/3rdparty/v1/devices HTTP/1.1
104-
Authorization: Basic {{credentials}}
108+
# Authorization: Basic {{credentials}}
109+
Authorization: Bearer {{jwtToken}}
110+
105111

106112
###
107113
DELETE {{baseUrl}}/3rdparty/v1/devices/gF0jEYiaG_x9sI1YFWa7a HTTP/1.1
@@ -192,6 +198,31 @@ Content-Type: application/json
192198
}
193199
}
194200

201+
###
202+
POST {{baseUrl}}/3rdparty/v1/auth/token HTTP/1.1
203+
Authorization: Basic {{credentials}}
204+
Content-Type: application/json
205+
206+
{
207+
"ttl": 3600,
208+
"scopes": [
209+
"messages:send",
210+
"messages:read",
211+
"devices:list",
212+
"devices:write",
213+
"webhooks:list",
214+
"webhooks:write",
215+
"settings:read",
216+
"settings:write",
217+
"logs:read"
218+
]
219+
}
220+
221+
###
222+
DELETE {{baseUrl}}/3rdparty/v1/auth/token/w8pxz0a4Fwa4xgzyCvSeC HTTP/1.1
223+
Authorization: Basic {{credentials}}
224+
Content-Type: application/json
225+
195226
###
196227
GET http://localhost:3000/metrics HTTP/1.1
197228

0 commit comments

Comments
 (0)