-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(NODE-4960): UUID validation too strict #572
Conversation
src/binary.ts
Outdated
@@ -485,6 +471,26 @@ export class UUID extends Binary { | |||
return new UUID(ByteUtils.fromBase64(base64)); | |||
} | |||
|
|||
/** @internal */ | |||
static uuidBytesFromString(representation: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is redundant here since it's a static UUID
method
static uuidBytesFromString(representation: string) { | |
static bytesFromString(representation: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
|
||
/** | ||
* A class representation of the BSON UUID type. | ||
* @public | ||
*/ | ||
export class UUID extends Binary { | ||
static cacheHexString: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this safely be removed? It's a public property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, added it back and filed follow ups, we can deprecate it in the subtask I made and remove in v6
Description
What is changing?
Our UUID class generates UUID v4 instances but it does not need to contain only v4. We lift the validation on the version byte entirely here to support all uuid versions and "empty" uuid.
Is there new documentation needed for these changes?
What is the motivation for this change?
Double check the following
npm run lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript