-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when issuing missing API cookie
Fix a crash when issuing an API auth cookie to a browser that has an HTML auth cookie but no API one: https://hypothesis.sentry.io/issues/5906066249/ `AuthTicketCookieHelper.identity()` returns the entire `AuthTicket`, not just the `AuthTicket.id` string as `CookiePolicy.identity()` thought it did. Fix some variable names in `CooCookiePolicy` to reflect this. There's no actual functional change to `CookiePolicy`, just some names are changed. Also change `AuthTicketCookieHelper.remember()` to accept the entire `AuthTicket` as an argument not just the `AuthTicket.id` string since the entire `AuthTicket` is what `CookiePolicy` actually passes to it. This type/argument confusion was the cause of the Sentry issue linked above. Change `AuthTicketCookieHelper.add_ticket()` to return the entire `AuthTicket` not just the `AuthTicket.id` string. `CookiePolicy` calls `AuthTicketCookieHelper.add_ticket()` and then passes the return value to `AuthTicketCookieHelper.remember()` which now expects an entire `AuthTicket` not just an `AuthTicket.id` string. This makes things nice and symmetrical: `AuthTicketCookieHelper` always returns entire `AuthTicket`'s and accepts entire `AuthTicket`'s as arguments, it never deals in just `AuthTicket.id` strings.
- Loading branch information
Showing
3 changed files
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters