[SERVER-42808] Explore whether uassert validation of the nss can be done in the NamespaceStringOrUUID class via its constructor Created: 13/Aug/19  Updated: 27/Oct/23  Resolved: 22/Jun/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Backlog - Storage Execution Team
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Participants:

 Description   

NamespaceStringOrUUID performs no validation of the NamespaceString that can be passed in, and then blindly returns the value to any callers of NamespaceStringOrUUID::nss(). This is rather inconvenient because we must still pair using the nss() returns with something like CollectionCatalog:: resolveNamespaceStringOrUUID to do the nss validation, and we get something like this:

if (nssOrUUID.nss()) {
    auto nss = collectionCatalog->resolveNamespaceStringOrUUID(nssOrUUID);
    ....
}

We cannot trust anything returned from NamespaceStringOrUUID. UUIDs are at least generated internally, so they seem to be reliable.


Generated at Thu Feb 08 05:01:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.