Created by: oblivisheee
This pull request includes significant changes to the assistant/src/interfaces.rs
file to improve token handling and authentication, as well as updates to the conf/nginx.conf
file to handle CORS preflight requests. The most important changes are summarized below:
Improvements to Token Handling and Authentication:
-
assistant/src/interfaces.rs
: Updated thechat_session
function to use query parameters for tokens instead of headers. This includes modifications to extractauth_token
andsession_token
from the query parameters. [1] [2] -
assistant/src/interfaces.rs
: Introduced a new helper functiontoken_string_from_header
to convert token headers to strings, and updated various functions (get_chat
,get_chats
,create_chat
,delete_chat
) to use this helper function. [1] [2] [3] [4] -
assistant/src/interfaces.rs
: Refactoredauth_token_with_nats
to directly accept a string token instead of a header, improving the clarity and efficiency of token verification. [1] [2] -
assistant/src/interfaces.rs
: Modifiedprocess_session_token
to accept an optional string token instead of a header, streamlining session token processing.