Skip to content

Commit

Permalink
fix(identity-cache-key): Use hashed identifier (#68)
Browse files Browse the repository at this point in the history
* fix(identity-cache-key): Use hashed identifier

* bump patch version
  • Loading branch information
gagantrivedi authored Mar 19, 2024
1 parent 2bf5d3f commit a0b1c22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flagsmith/flagsmith-php-client",
"type": "library",
"version": "v4.2.0",
"version": "v4.2.1",
"license": "BSD-3-Clause",
"authors": [
{
Expand Down
3 changes: 2 additions & 1 deletion src/Utils/IdentitiesGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static function generateIdentitiesData(string $identifier, ?object $trait
public static function generateIdentitiesCacheKey(string $identifier, ?object $traits)
{
$hashedTraits = $traits !== null ? '.'.sha1(serialize($traits)) : '';
return 'Identity.'.$identifier.$hashedTraits;
$hashedIdentifier = sha1($identifier);
return 'Identity.'.$hashedIdentifier.$hashedTraits;
}
}

0 comments on commit a0b1c22

Please sign in to comment.