Skip to content

Commit 416c43a

Browse files
committed
reverting back to fixed api style
1 parent 9270a99 commit 416c43a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

llama_cpp/server/app.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,16 +240,17 @@ async def authenticate(
240240
return True
241241

242242
# check bearer credentials against the api_key
243-
if authorization: # and authorization.credentials == settings.api_key:
244-
goodkey,message=check_and_update_api_key(api_key=authorization.credentials,invocation_type="text")
245-
if goodkey:
243+
if authorization and authorization.credentials == settings.api_key:
244+
#goodkey,message=check_and_update_api_key(api_key=authorization.credentials,invocation_type="text")
245+
#if goodkey:
246246
# api key is valid
247-
return authorization.credentials
248-
else:
249-
raise HTTPException(
250-
status_code=status.HTTP_401_UNAUTHORIZED,
251-
detail=message,
252-
)
247+
# return authorization.credentials
248+
#else:
249+
# raise HTTPException(
250+
# status_code=status.HTTP_401_UNAUTHORIZED,
251+
# detail=message,
252+
# )
253+
return authorization.credentials
253254

254255
# raise http error 401
255256
raise HTTPException(

0 commit comments

Comments
 (0)