Skip to content

Commit 1cb033f

Browse files
committed
Enhance manufacturing view with security field indicators
- Added new security fields (JTAG Locked, EEPROM Write Protected, Pubkey Programmed, Signed Boot) to the manufacturing view. - Implemented formatting functions to visually represent security statuses (enabled, disabled, unknown) in the UI. - Updated the table structure to accommodate new fields and ensure proper data display in the manufacturing data table.
1 parent 1b7e76f commit 1cb033f

File tree

2 files changed

+62
-2
lines changed

2 files changed

+62
-2
lines changed

docs/api_endpoints.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ The endpoint returns a JSON array where each element represents a provisioned de
4747
"memory": "2GB",
4848
"manufacturer": "Sony UK",
4949
"secure": "yes",
50+
"jtag_locked": "1",
51+
"eeprom_write_protected": "1",
52+
"pubkey_programmed": "1",
53+
"signed_boot_enabled": "1",
5054
"provision_ts": "2025-04-28 13:53:28"
5155
},
5256
...
@@ -72,6 +76,10 @@ The endpoint returns a JSON array where each element represents a provisioned de
7276
|memory|Device memory size (e.g., "2GB")
7377
|manufacturer|Device manufacturer
7478
|secure|Whether a device has been provisioned with a device unique identity
79+
|jtag_locked|JTAG debugging lock status (1=locked, 0=unlocked, null=unknown)
80+
|eeprom_write_protected|EEPROM write protection status (1=enabled, 0=disabled, null=unknown)
81+
|pubkey_programmed|Customer public key programming status (1=programmed, 0=not programmed, null=unknown)
82+
|signed_boot_enabled|Signed boot enablement status (1=enabled, 0=disabled, null=unknown)
7583
|provision_ts|Timestamp of when the device was provisioned
7684
|===
7785

provisioner-service/src/views/manufacturing.csp

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@
134134
margin: 15px 0;
135135
border-left: 5px solid #d32f2f;
136136
}
137+
138+
.security-field {
139+
text-align: center;
140+
font-weight: bold;
141+
}
142+
143+
.security-enabled {
144+
color: #28a745;
145+
font-size: 14px;
146+
}
147+
148+
.security-disabled {
149+
color: #dc3545;
150+
font-size: 14px;
151+
}
152+
153+
.security-unknown {
154+
color: #6c757d;
155+
font-size: 14px;
156+
}
137157
</style>
138158
</head>
139159
<body>
@@ -178,6 +198,19 @@
178198
</div>
179199

180200
<script>
201+
// Function to format security field values
202+
function formatSecurityField(value) {
203+
if (value === null || value === undefined || value === '') {
204+
return '<span class="security-unknown">?</span>';
205+
} else if (value === '1') {
206+
return '<span class="security-enabled">✓</span>';
207+
} else if (value === '0') {
208+
return '<span class="security-disabled">✗</span>';
209+
} else {
210+
return '<span class="security-unknown">?</span>';
211+
}
212+
}
213+
181214
// Handle scroll indicator visibility
182215
function updateScrollIndicator() {
183216
const container = document.querySelector('.table-container');
@@ -252,6 +285,10 @@
252285
<th>Memory</th>
253286
<th>Manufacturer</th>
254287
<th>Secure</th>
288+
<th>JTAG Locked</th>
289+
<th>EEPROM WP</th>
290+
<th>Pubkey Prog.</th>
291+
<th>Signed Boot</th>
255292
</tr>
256293
</thead>
257294
<tbody>
@@ -276,13 +313,17 @@
276313
<td>${device.memory || ''}</td>
277314
<td>${device.manufacturer || ''}</td>
278315
<td>${device.secure || ''}</td>
316+
<td class="security-field">${formatSecurityField(device.jtag_locked)}</td>
317+
<td class="security-field">${formatSecurityField(device.eeprom_write_protected)}</td>
318+
<td class="security-field">${formatSecurityField(device.pubkey_programmed)}</td>
319+
<td class="security-field">${formatSecurityField(device.signed_boot_enabled)}</td>
279320
</tr>
280321
`;
281322
});
282323
} else {
283324
tableHtml += `
284325
<tr>
285-
<td colspan="15" class="no-devices">No manufacturing data available</td>
326+
<td colspan="19" class="no-devices">No manufacturing data available</td>
286327
</tr>
287328
`;
288329
}
@@ -333,7 +374,18 @@
333374
rows.forEach(row => {
334375
const rowData = [];
335376
row.querySelectorAll('td').forEach(cell => {
336-
rowData.push('"' + (cell.innerText || '') + '"');
377+
// For security fields, extract the symbol and convert to readable text
378+
let cellText = cell.innerText || '';
379+
if (cell.classList.contains('security-field')) {
380+
const span = cell.querySelector('span');
381+
if (span) {
382+
const symbol = span.innerText;
383+
if (symbol === '✓') cellText = 'Yes';
384+
else if (symbol === '✗') cellText = 'No';
385+
else if (symbol === '?') cellText = 'Unknown';
386+
}
387+
}
388+
rowData.push('"' + cellText + '"');
337389
});
338390
if (rowData.length > 1) { // Skip empty rows
339391
csvContent += rowData.join(',') + '\r\n';

0 commit comments

Comments
 (0)