-
Notifications
You must be signed in to change notification settings - Fork 114
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
Update to RFC 9562 #117
Update to RFC 9562 #117
Conversation
a3cbee1
to
022de58
Compare
Sorry for the 13-month delay on this! I think it is ready for review now. |
401484c
to
5f2ba72
Compare
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.
I have updated this to match the published RFC, which is number 9562.
As far as I can tell, the only changes since the 14th draft have been grammatical, not technical.
I just realized the coverage isnt running anymore... |
Got codecov set back up but it probably wont run on this until we merge. I added @dylan-bourque to the review to see if he has any feedback, but the changes seem correct to me and consistent with the verbiage in the latest RFC. Thank you for taking the time to update this. |
I gave this a quick scan and didn't see anything. I'm traveling today so won't have a chance to do a deeper review probably until Monday. |
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.
LGTM with a couple of nits
func (g *Gen) NewV6() (UUID, error) { | ||
/* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6 |
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.
Nit: maybe include the source link in the godoc comment so that someone doesn't have to dive into the code to find it.
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.
@dylan-bourque I thought about that, but I think it's too much information that most users won't care about. The link is only there to show the origin of the bit layout below it, which is not something that needs to be in the godoc. The README has links to the full RFC, and that shows up in the godoc already.
func (g *Gen) NewV7() (UUID, error) { | ||
var u UUID | ||
/* https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7 | ||
0 1 2 3 | ||
/* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7 |
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.
Same nit here
Co-authored-by: Cameron Ackerman <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #117 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 513 498 -15
=========================================
- Hits 513 498 -15 ☔ View full report in Codecov by Sentry. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/gofrs/uuid/v5](https://togithub.com/gofrs/uuid) | `v5.1.0` -> `v5.2.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgofrs%2fuuid%2fv5/v5.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgofrs%2fuuid%2fv5/v5.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgofrs%2fuuid%2fv5/v5.1.0/v5.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgofrs%2fuuid%2fv5/v5.1.0/v5.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>gofrs/uuid (github.com/gofrs/uuid/v5)</summary> ### [`v5.2.0`](https://togithub.com/gofrs/uuid/releases/tag/v5.2.0) [Compare Source](https://togithub.com/gofrs/uuid/compare/v5.1.0...v5.2.0) This minor release updates the UUID v6 and v7 features of package to be complaint to draft RFC-9562, which replaces the previous family of uuid drafts. Additionally, it adds more specific error types, and tunes up Github Actions safety practices #### What's Changed - Update to RFC 9562 by [@​kohenkatz](https://togithub.com/kohenkatz) in [https://github.com/gofrs/uuid/pull/117](https://togithub.com/gofrs/uuid/pull/117) - \[StepSecurity] Apply security best practices by [@​step-security-bot](https://togithub.com/step-security-bot) in [https://github.com/gofrs/uuid/pull/135](https://togithub.com/gofrs/uuid/pull/135) - Bump actions/checkout from 2.7.0 to 4.1.5 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/gofrs/uuid/pull/137](https://togithub.com/gofrs/uuid/pull/137) - Bump ossf/scorecard-action from 2.0.6 to 2.3.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/gofrs/uuid/pull/136](https://togithub.com/gofrs/uuid/pull/136) - Bump actions/dependency-review-action from 2.5.1 to 4.3.2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/gofrs/uuid/pull/138](https://togithub.com/gofrs/uuid/pull/138) - Bump actions/upload-artifact from 3.1.3 to 4.3.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/gofrs/uuid/pull/140](https://togithub.com/gofrs/uuid/pull/140) - Bump codecov/codecov-action from 2.1.0 to 4.3.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/gofrs/uuid/pull/139](https://togithub.com/gofrs/uuid/pull/139) - Implemented support for checkable errors by [@​PatrLind](https://togithub.com/PatrLind) in [https://github.com/gofrs/uuid/pull/131](https://togithub.com/gofrs/uuid/pull/131) #### New Contributors - [@​kohenkatz](https://togithub.com/kohenkatz) made their first contribution in [https://github.com/gofrs/uuid/pull/117](https://togithub.com/gofrs/uuid/pull/117) - [@​step-security-bot](https://togithub.com/step-security-bot) made their first contribution in [https://github.com/gofrs/uuid/pull/135](https://togithub.com/gofrs/uuid/pull/135) - [@​dependabot](https://togithub.com/dependabot) made their first contribution in [https://github.com/gofrs/uuid/pull/137](https://togithub.com/gofrs/uuid/pull/137) - [@​PatrLind](https://togithub.com/PatrLind) made their first contribution in [https://github.com/gofrs/uuid/pull/131](https://togithub.com/gofrs/uuid/pull/131) **Full Changelog**: gofrs/uuid@v5.1.0...v5.2.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on Monday" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cozy/cozy-stack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
On 2022-10-17, the IETF uuidrev workgroup published a new draft that replaces peabody draft 04. On 2023-11-06, they released draft 14.On 2024-05-07, the IETF published RFC 9562, obsoleting RFC 4122.This PR updates this project to implement the newest RFC. (fixes #118)
There are a few changes in documentation: mostly pointing to the new RFC URL, and adding comments as appropriate to explain the changes.
A new constant
VariantRFC9562
is added, with the oldVariantRFC4122
kept as an alias to it for backward compatibility.The one major code change is in the implementation of UUID version 6. Since draft-01, this version now
SHOULD
use new pseudo-random data for the final 62 bytes, instead of using aclock_seq
value for 14 of those bytes. (Although implementationsMAY
keep the oldclock_seq
behavior, this is discouraged, and is only allowed alongside keeping the MAC address as thenode
value. Since we are not keeping the MAC address, we also should not keep theclock_seq
.