@@ -139,39 +139,39 @@ test('testWebhookValidation', async function testWebhookValidation(): Promise<an
139
139
[ 'box-signature-version' ] : '1' ,
140
140
} ;
141
141
const headersWithJapanese : {
142
- readonly [ key : string ] : any ;
142
+ readonly [ key : string ] : string ;
143
143
} = {
144
144
...headers ,
145
145
...{
146
146
[ 'box-signature-primary' ] : 'LV2uCu+5NJtIHrCXDYgZ0v/PP5THGRuegw3RtdnEyuE=' ,
147
147
} ,
148
148
} ;
149
149
const headersWithEmoji : {
150
- readonly [ key : string ] : any ;
150
+ readonly [ key : string ] : string ;
151
151
} = {
152
152
...headers ,
153
153
...{
154
154
[ 'box-signature-primary' ] : 'xF/SDZosX4le+v4A0Qn59sZhuD1RqY5KRUKzVMSbh0E=' ,
155
155
} ,
156
156
} ;
157
157
const headersWithCarriageReturn : {
158
- readonly [ key : string ] : any ;
158
+ readonly [ key : string ] : string ;
159
159
} = {
160
160
...headers ,
161
161
...{
162
162
[ 'box-signature-primary' ] : 'SVkbKgy3dEEf2PbbzpNu2lDZS7zZ/aboU7HOZgBGrJk=' ,
163
163
} ,
164
164
} ;
165
165
const headersWithForwardSlash : {
166
- readonly [ key : string ] : any ;
166
+ readonly [ key : string ] : string ;
167
167
} = {
168
168
...headers ,
169
169
...{
170
170
[ 'box-signature-primary' ] : 't41PWT5ZB6OcysnD6SDy9Ud+p9hdXxIdXqcdweyZv/Q=' ,
171
171
} ,
172
172
} ;
173
173
const headersWithBackSlash : {
174
- readonly [ key : string ] : any ;
174
+ readonly [ key : string ] : string ;
175
175
} = {
176
176
...headers ,
177
177
...{
@@ -188,96 +188,96 @@ test('testWebhookValidation', async function testWebhookValidation(): Promise<an
188
188
epochSecondsToDateTime ( getEpochTimeInSeconds ( ) - 1200 ) ,
189
189
) ;
190
190
const headersWithCorrectDatetime : {
191
- readonly [ key : string ] : any ;
191
+ readonly [ key : string ] : string ;
192
192
} = {
193
193
...headers ,
194
194
...{
195
195
[ 'box-delivery-timestamp' ] : currentDatetime ,
196
- [ 'box-signature-primary' ] : await computeWebhookSignature (
196
+ [ 'box-signature-primary' ] : ( await computeWebhookSignature (
197
197
body ,
198
198
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : currentDatetime } } ,
199
199
primaryKey ,
200
200
true ,
201
- ) ,
202
- [ 'box-signature-secondary' ] : await computeWebhookSignature (
201
+ ) ) ! ,
202
+ [ 'box-signature-secondary' ] : ( await computeWebhookSignature (
203
203
body ,
204
204
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : currentDatetime } } ,
205
205
secondaryKey ,
206
206
true ,
207
- ) ,
207
+ ) ) ! ,
208
208
} ,
209
209
} ;
210
210
const headersWithJapaneseWithCorrectDatetime : {
211
- readonly [ key : string ] : any ;
211
+ readonly [ key : string ] : string ;
212
212
} = {
213
213
...headersWithJapanese ,
214
214
...{
215
215
[ 'box-delivery-timestamp' ] : currentDatetime ,
216
- [ 'box-signature-primary' ] : await computeWebhookSignature (
216
+ [ 'box-signature-primary' ] : ( await computeWebhookSignature (
217
217
bodyWithJapanese ,
218
218
{
219
219
...headersWithJapanese ,
220
220
...{ [ 'box-delivery-timestamp' ] : currentDatetime } ,
221
221
} ,
222
222
primaryKey ,
223
223
true ,
224
- ) ,
225
- [ 'box-signature-secondary' ] : await computeWebhookSignature (
224
+ ) ) ! ,
225
+ [ 'box-signature-secondary' ] : ( await computeWebhookSignature (
226
226
bodyWithJapanese ,
227
227
{
228
228
...headersWithJapanese ,
229
229
...{ [ 'box-delivery-timestamp' ] : currentDatetime } ,
230
230
} ,
231
231
secondaryKey ,
232
232
true ,
233
- ) ,
233
+ ) ) ! ,
234
234
} ,
235
235
} ;
236
236
const headersWithFutureDatetime : {
237
- readonly [ key : string ] : any ;
237
+ readonly [ key : string ] : string ;
238
238
} = {
239
239
...headers ,
240
240
...{
241
241
[ 'box-delivery-timestamp' ] : futureDatetime ,
242
- [ 'box-signature-primary' ] : await computeWebhookSignature (
242
+ [ 'box-signature-primary' ] : ( await computeWebhookSignature (
243
243
body ,
244
244
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : futureDatetime } } ,
245
245
primaryKey ,
246
246
true ,
247
- ) ,
248
- [ 'box-signature-secondary' ] : await computeWebhookSignature (
247
+ ) ) ! ,
248
+ [ 'box-signature-secondary' ] : ( await computeWebhookSignature (
249
249
body ,
250
250
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : futureDatetime } } ,
251
251
secondaryKey ,
252
252
true ,
253
- ) ,
253
+ ) ) ! ,
254
254
} ,
255
255
} ;
256
256
const headersWithPastDatetime : {
257
- readonly [ key : string ] : any ;
257
+ readonly [ key : string ] : string ;
258
258
} = {
259
259
...headers ,
260
260
...{
261
261
[ 'box-delivery-timestamp' ] : pastDatetime ,
262
- [ 'box-signature-primary' ] : await computeWebhookSignature (
262
+ [ 'box-signature-primary' ] : ( await computeWebhookSignature (
263
263
body ,
264
264
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : pastDatetime } } ,
265
265
primaryKey ,
266
266
true ,
267
- ) ,
268
- [ 'box-signature-secondary' ] : await computeWebhookSignature (
267
+ ) ) ! ,
268
+ [ 'box-signature-secondary' ] : ( await computeWebhookSignature (
269
269
body ,
270
270
{ ...headers , ...{ [ 'box-delivery-timestamp' ] : pastDatetime } } ,
271
271
secondaryKey ,
272
272
true ,
273
- ) ,
273
+ ) ) ! ,
274
274
} ,
275
275
} ;
276
276
const headersWithWrongSignatureVersion : {
277
- readonly [ key : string ] : any ;
277
+ readonly [ key : string ] : string ;
278
278
} = { ...headers , ...{ [ 'box-signature-version' ] : '2' } } ;
279
279
const headersWithWrongSignatureAlgorithm : {
280
- readonly [ key : string ] : any ;
280
+ readonly [ key : string ] : string ;
281
281
} = { ...headers , ...{ [ 'box-signature-algorithm' ] : 'HmacSHA1' } } ;
282
282
if (
283
283
! ( await compareSignatures (
0 commit comments