Skip to content
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

Small changes around node IDs and trace IDs #2202

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

josephschorr
Copy link
Member

  1. Moves the default node ID to use a hash in case the hostname has anything sensitive in it
  2. Moves the trace ID generation to a single method, in case we choose to change its implementation in the future to something less intensive to run

In the future, we might optimize this to use a less-intensive method to generate IDs
@josephschorr josephschorr requested a review from a team as a code owner January 10, 2025 16:00
@github-actions github-actions bot added the area/api v1 Affects the v1 API label Jan 10, 2025
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

defaultNodeID = spiceDBPrefix + hostname

// Hash the hostname to get the final default node ID.
hasher := xxhash.New()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Move this out of the function?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we cache the name globally after computation, I think this is fine

@josephschorr josephschorr added this pull request to the merge queue Jan 10, 2025
Merged via the queue into authzed:main with commit 6609142 Jan 10, 2025
23 checks passed
@josephschorr josephschorr deleted the trace-node-id branch January 10, 2025 16:58
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/api v1 Affects the v1 API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants