Skip to content

Commit

Permalink
feat: dump key to log
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Oct 6, 2023
1 parent 37de111 commit 599a857
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion free_one_api/impls/forward/mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ async def query(
id_suffix += chan.adapter.__class__.__name__[:10]
id_suffix += "".join(random.choices(string.ascii_letters+string.digits, k=29-len(id_suffix)))

query_info_str = f"type=query, path={path}, model={req.model}, id_suffix={id_suffix}, channel_name={chan.name}, channel_adpater={chan.adapter.__class__.__name__}"
auth = quart.request.headers.get("Authorization")
if auth.startswith("Bearer "):
auth = auth[7:]

query_info_str = f"type=query, path={path}, model={req.model}, id_suffix={id_suffix}, channel_name={chan.name}, channel_adpater={chan.adapter.__class__.__name__}, key={auth}"

logging.info(query_info_str)

Expand Down

0 comments on commit 599a857

Please sign in to comment.