8000 fix(flags): pass in the correct hashes. by dmarticus · Pull Request #221 · PostHog/posthog-python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(flags): pass in the correct hashes. #221

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

Merged
merged 4 commits into from
Apr 15, 2025
Merged

fix(flags): pass in the correct hashes. #221

merged 4 commits into from
Apr 15, 2025

Conversation

dmarticus
Copy link
Contributor

did the flag hashing algorithm incorrectly and passed in SHA256 instead of sha1 hashes... stupid script.

This works and I confirmed with more unit tests.

< 8000 div data-view-component="true" class="TimelineItem pt-0">
Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes the feature flag rollout hashing algorithm by switching from SHA256 to SHA1 hashes for token validation, ensuring consistent behavior with the existing is_token_in_rollout implementation.

  • Updated INCLUDED_HASHES and EXCLUDED_HASHES sets in client.py with correct SHA1 hashes instead of SHA256
  • Added test case in test_client.py to verify PostHog API key is correctly included in rollout calculations
  • Fixed potential issue where tokens could be incorrectly included/excluded from rollouts due to hash mismatch
  • Ensures backward compatibility since is_token_in_rollout was already using SHA1

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@dmarticus dmarticus merged commit dfa7f70 into master Apr 15, 2025
6 checks passed
@dmarticus dmarticus deleted the fix/bad-hashes branch April 15, 2025 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0