mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-31 05:50:01 +00:00
fix unit tests
This commit is contained in:
parent
b937a49436
commit
01fac67e33
6 changed files with 37 additions and 40 deletions
|
|
@ -166,18 +166,16 @@ class AuthenticationMiddleware:
|
|||
# Parse and validate the auth response
|
||||
try:
|
||||
response_data = response.json()
|
||||
|
||||
auth_response = AuthResponse(**response_data)
|
||||
|
||||
# Store attributes in request scope for access control
|
||||
if auth_response.access_attributes:
|
||||
user_attributes = auth_response.access_attributes.model_dump(exclude_none=True)
|
||||
scope["user_attributes"] = user_attributes
|
||||
else:
|
||||
logger.warning("Authentication response did not contain any attributes")
|
||||
scope["user_attributes"] = {}
|
||||
user_attributes = {}
|
||||
|
||||
# Log authentication success with attribute details
|
||||
scope["user_attributes"] = user_attributes
|
||||
logger.debug(f"Authentication successful: {len(user_attributes)} attributes")
|
||||
except Exception:
|
||||
logger.exception("Error parsing authentication response")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue