Skip to content

want validation for Oxide serial numbers in the control plane #8742

@hawkw

Description

@hawkw

For purposes like inventory and fault management, the control plane must often deal in Oxide serial numbers. Presently, we just represent these as Strings in Rust (or TEXT in CRDB) pretty pervasively. In many cases, it would be nice to have a representation for parsed and validated serials.

The primary motivation for this is stuff like what @smklein mentions in #8739 (comment) --- when writing ereports in a support bundle, we would like to include serial numbers in a filesystem path, and should therefore be able to ensure that serials received from the outside world don't contain unsavoury characters.

Another motivation, though, is that both the V1 and V2 Oxide serial formats described in RFD 219 are of fixed length and contain only ASCII characters. Thus, we ought to be able to store them as fixed-size arrays of 11 bytes, rather than UTF-8 Strings on the heap, which might be a bit more efficient when copying serials around.

Hubris has an oxide-barcode crate for this purpose, which includes parsing code. Perhaps we could depend on the parsing logic from there, or steal code from it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions