Skip to content

Commit b2d8b4f

Browse files
author
Varun Rathore
committed
Add farmhash to extension whitelist pkg
1 parent 94afdbe commit b2d8b4f

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ unsafe-load-any-extension=no
3232
# A comma-separated list of package or module names from where C extensions may
3333
# be loaded. Extensions are loading into the active Python interpreter and may
3434
# run arbitrary code
35-
extension-pkg-whitelist=
35+
extension-pkg-whitelist= farmhash
3636

3737
# Allow optimization of some AST trees. This will activate a peephole AST
3838
# optimizer, which will apply various small optimizations. For instance, it can

firebase_admin/_http_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,11 @@ def __init__(self, **kwargs):
148148

149149
def parse_body(self, resp):
150150
return resp.json()
151+
152+
class RemoteConfigApiClient(HttpClient):
153+
"""An HTTP client that parses response messages as JSON."""
154+
def __init__(self, **kwargs):
155+
HttpClient.__init__(self, **kwargs)
156+
def parse_body(self, resp):
157+
return resp.json()
158+

firebase_admin/remote_config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def hash_seeded_randomization_id(self, seeded_randomization_id: str) -> int:
392392
Returns:
393393
The hashed value.
394394
"""
395-
hash64 = farmhash.hash64withseed(seeded_randomization_id)
395+
hash64 = farmhash.fingerprint64(seeded_randomization_id)
396396
return abs(hash64)
397397
def evaluate_custom_signal_condition(self, custom_signal_condition,
398398
context) -> bool:
@@ -599,4 +599,3 @@ def as_number(self) -> float:
599599
def get_source(self) -> ValueSource:
600600
"""Returns the source of the value."""
601601
return self.source
602-

0 commit comments

Comments
 (0)