-
Notifications
You must be signed in to change notification settings - Fork 9
fix: auth cookie serialization/deserialization #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Good from my side but cannot hit "Approve" since I opened PR 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that at n point are we actually testing a full end-to-end writing and reading of the cookie. We're only using mocks. Since we ran into problems during the development of this branch I think it would be prudent to add a test that doesn't actually mock the setting and reading of cookies. vitest has a jsdom enviromnent available, which I assume will be able to write and read cookies, including handling of cookie expiration etc
That would be testing the functionality of the |
Unless we have a good explanation for why @matus-vacula hit a case where cookie readind was not unescaped correctly, and a guarantee that we cannot hit this case accidentally again, I do indeed think we should be testing the full flow, including the cookie library. We might want to upgrade the library at some point, and with no test to verify that functionality is intact, we might well regress here in the future |
I think the escaping problem might have been from an incorrect linking of the SDK. |
Right, I still think it's an overkill but I have basically added all kinds of tests on "real cookies". This will at least ensure the formatting stays consistent across versions of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried sending a prompt locally and that works 👍
This PR fixes an issue with cached token serialization and adds preventive fix in case a token is manually modified or possibly invalid due to server-side credential changes.