THRIFT-5939: Replace GUID generation with stable UUID algorithm#3366
Open
Jens-G wants to merge 1 commit intoapache:masterfrom
Open
THRIFT-5939: Replace GUID generation with stable UUID algorithm#3366Jens-G wants to merge 1 commit intoapache:masterfrom
Jens-G wants to merge 1 commit intoapache:masterfrom
Conversation
Replace the Windows-only random CoCreateGuid() GUID generation with deterministic UUIDv8 (RFC 9562) derived from SHA-256 over a namespace hierarchy (DNS → thrift.apache.org → program → interface metadata). Uses SHA-256 implementation by Brad Conte (brad AT bradconte.com), which is explicitly public domain (no copyright claimed). Source: https://github.com/B-Con/crypto-algorithms - sha256.h: Brad Conte's algorithm verbatim, inlined to a header-only file, macros prefixed THRIFT_SHA256_ to avoid collisions - Add generate_guid_v8() for services and structs using a canonical string covering: program namespace UUID, entity name, parent service hash (for inheritance), and function/field signatures with Thrift IDL type names - Add type_name_for_guid(), canonical_service_string(), canonical_struct_string(), program_namespace_uuid() helpers - Add guid_v4 generator option to fall back to legacy random GUIDs (Windows only, for migration compatibility) - GUIDs are now emitted on all platforms, not just Windows - Add UuidV8Test.thrift fixture and CI step that validates determinism, UUIDv8 format, field-order sensitivity, and parent-service hash inclusion - LICENSE: add attribution section for the third-party public-domain code, following the existing pattern in the file Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the Windows-only random CoCreateGuid() GUID generation with deterministic UUIDv8 (RFC 9562) derived from SHA-256 over a namespace hierarchy (DNS → thrift.apache.org → program → interface metadata).
Uses SHA-256 implementation by Brad Conte (brad AT bradconte.com), which is explicitly public domain (no copyright claimed). Source: https://github.com/B-Con/crypto-algorithms