-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.html
553 lines (500 loc) · 45.1 KB
/
report.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Report</title>
<style>body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
/* do not increase min-width as some may use split screens */
min-width: 800px;
color: #999;
}
h1 {
font-size: 24px;
color: black;
}
h2 {
font-size: 16px;
color: black;
}
p {
color: black;
}
a {
color: #999;
}
table {
border-collapse: collapse;
}
/******************************
* SUMMARY INFORMATION
******************************/
#environment td {
padding: 5px;
border: 1px solid #E6E6E6;
}
#environment tr:nth-child(odd) {
background-color: #f6f6f6;
}
/******************************
* TEST RESULT COLORS
******************************/
span.passed,
.passed .col-result {
color: green;
}
span.skipped,
span.xfailed,
span.rerun,
.skipped .col-result,
.xfailed .col-result,
.rerun .col-result {
color: orange;
}
span.error,
span.failed,
span.xpassed,
.error .col-result,
.failed .col-result,
.xpassed .col-result {
color: red;
}
/******************************
* RESULTS TABLE
*
* 1. Table Layout
* 2. Extra
* 3. Sorting items
*
******************************/
/*------------------
* 1. Table Layout
*------------------*/
#results-table {
border: 1px solid #e6e6e6;
color: #999;
font-size: 12px;
width: 100%;
}
#results-table th,
#results-table td {
padding: 5px;
border: 1px solid #E6E6E6;
text-align: left;
}
#results-table th {
font-weight: bold;
}
/*------------------
* 2. Extra
*------------------*/
.log {
background-color: #e6e6e6;
border: 1px solid #e6e6e6;
color: black;
display: block;
font-family: "Courier New", Courier, monospace;
height: 230px;
overflow-y: scroll;
padding: 5px;
white-space: pre-wrap;
}
.log:only-child {
height: inherit;
}
div.image {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.image img {
width: 320px;
}
div.video {
border: 1px solid #e6e6e6;
float: right;
height: 240px;
margin-left: 5px;
overflow: hidden;
width: 320px;
}
div.video video {
overflow: hidden;
width: 320px;
height: 240px;
}
.collapsed {
display: none;
}
.expander::after {
content: " (show details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
.collapser::after {
content: " (hide details)";
color: #BBB;
font-style: italic;
cursor: pointer;
}
/*------------------
* 3. Sorting items
*------------------*/
.sortable {
cursor: pointer;
}
.sort-icon {
font-size: 0px;
float: left;
margin-right: 5px;
margin-top: 5px;
/*triangle*/
width: 0;
height: 0;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}
.inactive .sort-icon {
/*finish triangle*/
border-top: 8px solid #E6E6E6;
}
.asc.active .sort-icon {
/*finish triangle*/
border-bottom: 8px solid #999;
}
.desc.active .sort-icon {
/*finish triangle*/
border-top: 8px solid #999;
}
</style></head>
<body onLoad="init()">
<script>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
function toArray(iter) {
if (iter === null) {
return null;
}
return Array.prototype.slice.call(iter);
}
function find(selector, elem) { // eslint-disable-line no-redeclare
if (!elem) {
elem = document;
}
return elem.querySelector(selector);
}
function findAll(selector, elem) {
if (!elem) {
elem = document;
}
return toArray(elem.querySelectorAll(selector));
}
function sortColumn(elem) {
toggleSortStates(elem);
const colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
let key;
if (elem.classList.contains('result')) {
key = keyResult;
} else if (elem.classList.contains('links')) {
key = keyLink;
} else {
key = keyAlpha;
}
sortTable(elem, key(colIndex));
}
function showAllExtras() { // eslint-disable-line no-unused-vars
findAll('.col-result').forEach(showExtras);
}
function hideAllExtras() { // eslint-disable-line no-unused-vars
findAll('.col-result').forEach(hideExtras);
}
function showExtras(colresultElem) {
const extras = colresultElem.parentNode.nextElementSibling;
const expandcollapse = colresultElem.firstElementChild;
extras.classList.remove('collapsed');
expandcollapse.classList.remove('expander');
expandcollapse.classList.add('collapser');
}
function hideExtras(colresultElem) {
const extras = colresultElem.parentNode.nextElementSibling;
const expandcollapse = colresultElem.firstElementChild;
extras.classList.add('collapsed');
expandcollapse.classList.remove('collapser');
expandcollapse.classList.add('expander');
}
function showFilters() {
const filterItems = document.getElementsByClassName('filter');
for (let i = 0; i < filterItems.length; i++)
filterItems[i].hidden = false;
}
function addCollapse() {
// Add links for show/hide all
const resulttable = find('table#results-table');
const showhideall = document.createElement('p');
showhideall.innerHTML = '<a href="javascript:showAllExtras()">Show all details</a> / ' +
'<a href="javascript:hideAllExtras()">Hide all details</a>';
resulttable.parentElement.insertBefore(showhideall, resulttable);
// Add show/hide link to each result
findAll('.col-result').forEach(function(elem) {
const collapsed = getQueryParameter('collapsed') || 'Passed';
const extras = elem.parentNode.nextElementSibling;
const expandcollapse = document.createElement('span');
if (extras.classList.contains('collapsed')) {
expandcollapse.classList.add('expander');
} else if (collapsed.includes(elem.innerHTML)) {
extras.classList.add('collapsed');
expandcollapse.classList.add('expander');
} else {
expandcollapse.classList.add('collapser');
}
elem.appendChild(expandcollapse);
elem.addEventListener('click', function(event) {
if (event.currentTarget.parentNode.nextElementSibling.classList.contains('collapsed')) {
showExtras(event.currentTarget);
} else {
hideExtras(event.currentTarget);
}
});
});
}
function getQueryParameter(name) {
const match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function init () { // eslint-disable-line no-unused-vars
resetSortHeaders();
addCollapse();
showFilters();
sortColumn(find('.initial-sort'));
findAll('.sortable').forEach(function(elem) {
elem.addEventListener('click',
function() {
sortColumn(elem);
}, false);
});
}
function sortTable(clicked, keyFunc) {
const rows = findAll('.results-table-row');
const reversed = !clicked.classList.contains('asc');
const sortedRows = sort(rows, keyFunc, reversed);
/* Whole table is removed here because browsers acts much slower
* when appending existing elements.
*/
const thead = document.getElementById('results-table-head');
document.getElementById('results-table').remove();
const parent = document.createElement('table');
parent.id = 'results-table';
parent.appendChild(thead);
sortedRows.forEach(function(elem) {
parent.appendChild(elem);
});
document.getElementsByTagName('BODY')[0].appendChild(parent);
}
function sort(items, keyFunc, reversed) {
const sortArray = items.map(function(item, i) {
return [keyFunc(item), i];
});
sortArray.sort(function(a, b) {
const keyA = a[0];
const keyB = b[0];
if (keyA == keyB) return 0;
if (reversed) {
return keyA < keyB ? 1 : -1;
} else {
return keyA > keyB ? 1 : -1;
}
});
return sortArray.map(function(item) {
const index = item[1];
return items[index];
});
}
function keyAlpha(colIndex) {
return function(elem) {
return elem.childNodes[1].childNodes[colIndex].firstChild.data.toLowerCase();
};
}
function keyLink(colIndex) {
return function(elem) {
const dataCell = elem.childNodes[1].childNodes[colIndex].firstChild;
return dataCell == null ? '' : dataCell.innerText.toLowerCase();
};
}
function keyResult(colIndex) {
return function(elem) {
const strings = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed',
'Skipped', 'Passed'];
return strings.indexOf(elem.childNodes[1].childNodes[colIndex].firstChild.data);
};
}
function resetSortHeaders() {
findAll('.sort-icon').forEach(function(elem) {
elem.parentNode.removeChild(elem);
});
findAll('.sortable').forEach(function(elem) {
const icon = document.createElement('div');
icon.className = 'sort-icon';
icon.textContent = 'vvv';
elem.insertBefore(icon, elem.firstChild);
elem.classList.remove('desc', 'active');
elem.classList.add('asc', 'inactive');
});
}
function toggleSortStates(elem) {
//if active, toggle between asc and desc
if (elem.classList.contains('active')) {
elem.classList.toggle('asc');
elem.classList.toggle('desc');
}
//if inactive, reset all other functions and add ascending active
if (elem.classList.contains('inactive')) {
resetSortHeaders();
elem.classList.remove('inactive');
elem.classList.add('active');
}
}
function isAllRowsHidden(value) {
return value.hidden == false;
}
function filterTable(elem) { // eslint-disable-line no-unused-vars
const outcomeAtt = 'data-test-result';
const outcome = elem.getAttribute(outcomeAtt);
const classOutcome = outcome + ' results-table-row';
const outcomeRows = document.getElementsByClassName(classOutcome);
for(let i = 0; i < outcomeRows.length; i++){
outcomeRows[i].hidden = !elem.checked;
}
const rows = findAll('.results-table-row').filter(isAllRowsHidden);
const allRowsHidden = rows.length == 0 ? true : false;
const notFoundMessage = document.getElementById('not-found-message');
notFoundMessage.hidden = !allRowsHidden;
}
</script>
<h1>report.html</h1>
<p>Report generated on 03-Feb-2021 at 23:28:56 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v3.1.1</p>
<h2>Environment</h2>
<table id="environment">
<tr>
<td>Packages</td>
<td>{"pluggy": "0.13.1", "py": "1.10.0", "pytest": "6.2.2"}</td></tr>
<tr>
<td>Platform</td>
<td>Darwin-19.6.0-x86_64-i386-64bit</td></tr>
<tr>
<td>Plugins</td>
<td>{"flake8": "1.0.7", "html": "3.1.1", "metadata": "1.11.0"}</td></tr>
<tr>
<td>Python</td>
<td>3.7.5</td></tr></table>
<h2>Summary</h2>
<p>4 tests ran in 3.02 seconds. </p>
<p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="passed">4 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="failed">0 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filterTable(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>
<h2>Results</h2>
<table id="results-table">
<thead id="results-table-head">
<tr>
<th class="sortable result initial-sort" col="result">Result</th>
<th class="sortable" col="name">Test</th>
<th class="sortable" col="duration">Duration</th>
<th class="sortable links" col="links">Links</th></tr>
<tr hidden="true" id="not-found-message">
<th colspan="4">No results found. Try to check the filters</th></tr></thead>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">src/tests/lambda_authorizer_tests.py::test_valid_device_token</td>
<td class="col-duration">1.30</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stderr call------------------------------ <br/>/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 13 - {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT'}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 14 - Client token: DeviceToken NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 15 - Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/venv/lib/python3.7/site-packages/botocore/credentials.py - INFO - load - 1210 - Found credentials in shared credentials file: ~/.aws/credentials
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 268 - {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '1a8aefc5-a832-4de4-aca3-b60230781e22', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:55 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '1a8aefc5-a832-4de4-aca3-b60230781e22'}, 'RetryAttempts': 0}}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 277 - {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 31 - {'principalId': 'DeviceTokenNjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Allow', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register']}]}}
<br/> -------------------------------Captured log call-------------------------------- <br/>INFO root:lambda_authorizer.py:13 {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT'}
INFO root:lambda_authorizer.py:14 Client token: DeviceToken NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT
INFO root:lambda_authorizer.py:15 Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
INFO botocore.credentials:credentials.py:1210 Found credentials in shared credentials file: ~/.aws/credentials
INFO root:aws.py:268 {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '1a8aefc5-a832-4de4-aca3-b60230781e22', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:55 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '1a8aefc5-a832-4de4-aca3-b60230781e22'}, 'RetryAttempts': 0}}
INFO root:aws.py:277 {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
INFO root:lambda_authorizer.py:31 {'principalId': 'DeviceTokenNjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Allow', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register']}]}}<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">src/tests/lambda_authorizer_tests.py::test_invalid_device_token</td>
<td class="col-duration">0.39</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stderr call------------------------------ <br/>/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 13 - {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken 123'}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 14 - Client token: DeviceToken 123
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 15 - Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 268 - {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '35e7f20b-71c8-493e-9ed4-a7bbab7729ff', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '35e7f20b-71c8-493e-9ed4-a7bbab7729ff'}, 'RetryAttempts': 0}}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 277 - {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - generate_policy - 95 - Denying all methods due to a failure in authorization - True - True - False
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 31 - {'principalId': 'DeviceToken123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}
<br/> -------------------------------Captured log call-------------------------------- <br/>INFO root:lambda_authorizer.py:13 {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken 123'}
INFO root:lambda_authorizer.py:14 Client token: DeviceToken 123
INFO root:lambda_authorizer.py:15 Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
INFO root:aws.py:268 {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '35e7f20b-71c8-493e-9ed4-a7bbab7729ff', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '35e7f20b-71c8-493e-9ed4-a7bbab7729ff'}, 'RetryAttempts': 0}}
INFO root:aws.py:277 {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
ERROR root:generic.py:95 Denying all methods due to a failure in authorization - True - True - False
INFO root:lambda_authorizer.py:31 {'principalId': 'DeviceToken123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">src/tests/lambda_authorizer_tests.py::test_invalid_token_prefix</td>
<td class="col-duration">0.39</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stderr call------------------------------ <br/>/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 13 - {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'Token 123'}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 14 - Client token: Token 123
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 15 - Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 268 - {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': 'c382a853-1f44-4bce-bb5e-62c2050e8979', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': 'c382a853-1f44-4bce-bb5e-62c2050e8979'}, 'RetryAttempts': 0}}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 277 - {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - validate_token - 55 - Error validating the received token...
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - generate_policy - 95 - Denying all methods due to a failure in authorization - True - False - False
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 31 - {'principalId': 'Token123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}
<br/> -------------------------------Captured log call-------------------------------- <br/>INFO root:lambda_authorizer.py:13 {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'Token 123'}
INFO root:lambda_authorizer.py:14 Client token: Token 123
INFO root:lambda_authorizer.py:15 Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
INFO root:aws.py:268 {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': 'c382a853-1f44-4bce-bb5e-62c2050e8979', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': 'c382a853-1f44-4bce-bb5e-62c2050e8979'}, 'RetryAttempts': 0}}
INFO root:aws.py:277 {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
ERROR root:generic.py:55 Error validating the received token...
ERROR root:generic.py:95 Denying all methods due to a failure in authorization - True - False - False
INFO root:lambda_authorizer.py:31 {'principalId': 'Token123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}<br/></div></td></tr></tbody>
<tbody class="passed results-table-row">
<tr>
<td class="col-result">Passed</td>
<td class="col-name">src/tests/lambda_authorizer_tests.py::test_invalid_token_composition</td>
<td class="col-duration">0.40</td>
<td class="col-links"></td></tr>
<tr>
<td class="extra" colspan="4">
<div class="log"> ------------------------------Captured stderr call------------------------------ <br/>/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 13 - {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken-123'}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 14 - Client token: DeviceToken-123
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 15 - Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 268 - {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '23312ec1-9848-4d4f-a9d2-1e8dd0572ece', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '23312ec1-9848-4d4f-a9d2-1e8dd0572ece'}, 'RetryAttempts': 0}}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/handlers/aws.py - INFO - get_config - 277 - {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - validate_token - 55 - Error validating the received token...
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - authorize_token - 66 - Error authorizing token...
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/components/authorizers/api_gateway/custom/generic.py - ERROR - generate_policy - 95 - Denying all methods due to a failure in authorization - True - False - False
/Users/el_u93/Documents/projects/multa-certificate-vending-machine/src/applications/aws_lambda/basic/lambda_authorizer.py - INFO - lambda_handler - 31 - {'principalId': 'DeviceToken-123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}
<br/> -------------------------------Captured log call-------------------------------- <br/>INFO root:lambda_authorizer.py:13 {'type': 'TOKEN', 'methodArn': 'arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register', 'authorizationToken': 'DeviceToken-123'}
INFO root:lambda_authorizer.py:14 Client token: DeviceToken-123
INFO root:lambda_authorizer.py:15 Method ARN: arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/POST/register
INFO root:aws.py:268 {'Parameters': [{'Name': '/multa-cvm/dev/config-parameters/appConfig', 'Type': 'String', 'Value': '{"AWS_ROOT_CA": {"PREFERRED": "https://www.amazontrust.com/repository/AmazonRootCA1.pem", "BACKUP": "https://www.amazontrust.com/repository/AmazonRootCA3.pem"}, "POLICIES": {"CvmGenericType": {"name": "multa_backend_policy_dev"}}, "ATTRIBUTES": {"CvmGenericType": [{"name": "creationDate"}, {"name": "version"}]}, "DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH": "2", "DEVICE_AUTHORIZER_TOKEN_IDENTIFIER": "DeviceToken", "DEVICE_AUTHORIZER_VALID_TOKENS": ["NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT"]}', 'Version': 7, 'LastModifiedDate': datetime.datetime(2021, 2, 3, 22, 58, 33, 228000, tzinfo=tzlocal()), 'ARN': 'arn:aws:ssm:us-east-1:112646120612:parameter/multa-cvm/dev/config-parameters/appConfig', 'DataType': 'text'}], 'ResponseMetadata': {'RequestId': '23312ec1-9848-4d4f-a9d2-1e8dd0572ece', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Thu, 04 Feb 2021 04:28:56 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '785', 'connection': 'keep-alive', 'x-amzn-requestid': '23312ec1-9848-4d4f-a9d2-1e8dd0572ece'}, 'RetryAttempts': 0}}
INFO root:aws.py:277 {'AWS_ROOT_CA': {'PREFERRED': 'https://www.amazontrust.com/repository/AmazonRootCA1.pem', 'BACKUP': 'https://www.amazontrust.com/repository/AmazonRootCA3.pem'}, 'POLICIES': {'CvmGenericType': {'name': 'multa_backend_policy_dev'}}, 'ATTRIBUTES': {'CvmGenericType': [{'name': 'creationDate'}, {'name': 'version'}]}, 'DEVICE_AUTHORIZER_TOKEN_PAYLOAD_LENGTH': '2', 'DEVICE_AUTHORIZER_TOKEN_IDENTIFIER': 'DeviceToken', 'DEVICE_AUTHORIZER_VALID_TOKENS': ['NjWO2tVh6fVAeNuLwRsPi-c6N7SP5-DT']}
ERROR root:generic.py:55 Error validating the received token...
ERROR root:generic.py:66 Error authorizing token...
ERROR root:generic.py:95 Denying all methods due to a failure in authorization - True - False - False
INFO root:lambda_authorizer.py:31 {'principalId': 'DeviceToken-123', 'policyDocument': {'Version': '2012-10-17', 'Statement': [{'Action': 'execute-api:Invoke', 'Effect': 'Deny', 'Resource': ['arn:aws:execute-api:us-east-1:112646120612:n8il2c2eic/prod/*/*']}]}}<br/></div></td></tr></tbody></table></body></html>