Skip to content

Commit

Permalink
Merge pull request #1415 from p-l-/fix-web-demo
Browse files Browse the repository at this point in the history
Web/demo: fix (& document) get_anonymized_user() type
  • Loading branch information
p-l- committed Aug 2, 2022
2 parents fa4913e + 9821124 commit 5711b2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ivre/web/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ def query_from_params(params):
raise ValueError("Parameter parsing error") from exc


def get_user():
def get_user() -> str:
"""Return the connected user."""
return request.environ.get("REMOTE_USER")


def get_anonymized_user():
def get_anonymized_user() -> str:
"""Return the HMAC value of the current user authenticated with
the HMAC secret.
Expand All @@ -185,7 +185,7 @@ def get_anonymized_user():
secret = config.WEB_SECRET
return utils.encode_b64(
hmac.new(secret, msg=get_user().encode(), digestmod="sha256").digest()[:9]
)
).decode()


def _parse_query(dbase, query):
Expand Down

0 comments on commit 5711b2f

Please sign in to comment.