Delphic icon indicating copy to clipboard operation
Delphic copied to clipboard

Websocket Connection failure to Collection

Open professorDante opened this issue 2 years ago • 2 comments

Cannot open a WS connection to a newly uploaded Collection. On the frontend you see this:

Screen Shot 2023-07-16 at 2 33 57 PM

On the ASGI/WSGI dev server you see this:

Screen Shot 2023-07-16 at 2 36 03 PM

It looks like the API key being used by the WS frontend isn't available in the backend? Searching the docs gives no indication on what to do to set up an API key, aside from the OpenAI one.

professorDante avatar Jul 16 '23 21:07 professorDante

The situation is a bit messy... first, know that the APIkey "errors" you get on the back are just logspam, they don't indicate the problem. If you want to find where the problem really is, start removing try/catch blocks until the request actually crashes out with a 500 code and a traceback.

Second, there are two token auth systems in use, both only partly implemented. What you have in the log is a JWT token. What the APIKey model expects is a "normal" opaque bearer token. JWT controls access to most of the JSON API, whereas the APIKey controls access to... nothing. If you have or suspect auth problems, rip out the APIKey stuff starting from the part of the code producing all those warnings.

In my private version I've fixed APIKey and fully implemented JWT. If this repo becomes active again maybe the author would be interested in PRs for this stuff.

marauder37 avatar Jul 22 '23 22:07 marauder37

It's frustrating because I like the concepts they've used in this repo - WS to improve index load speed etc etc. I'd like to get this working and look to build from it. But it seems quite buggy and kind of half complete. Allowing the PRs to be in the master branch would help a ton. I fixed a bunch of issues pulling in your PR #85.

Where do I start to fix the JWT issue? Is there an endpoint?

professorDante avatar Jul 23 '23 17:07 professorDante