Skip to content
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

Cached WAC-allow headers and 403 and 401 responses must be ignored after login #441

Closed
timbl opened this issue Sep 27, 2020 · 8 comments · Fixed by SolidOS/solid-ui#536
Closed
Labels

Comments

@timbl
Copy link
Member

timbl commented Sep 27, 2020

Currently the quad store in the Fetcher keeps copies of the HTTP headers of each response, and uses that to test whether something is forbidden (403), and is if modifiable by the current user (WAC-Alllow). The problem is that if the app accesses a resource, gets those headers, and then the user logs in, the cached values will be wrong: the operation should be retried to get a value appropriate to the now-logged-in user.

So these functions need some way of testing the date-time of the user's last login status change.

An example problem causes by this is: SolidOS/chat-pane#48

@timbl
Copy link
Member Author

timbl commented Sep 27, 2020

I guess they should be ignored after logout too.

@timbl timbl added the bug label Sep 27, 2020
@timbl
Copy link
Member Author

timbl commented Sep 27, 2020

401 errors also should be ignored if the predate a login status change.

@timbl
Copy link
Member Author

timbl commented Nov 8, 2020

Suggest: Add a date to the fetcher when the login state changes. Likefetcher.loginTime = new Date()or something, and then extract the datetime of the responses being considered in the cache, and ignore cachshed 403 and 402 responses which predate the loginTime.

@timbl
Copy link
Member Author

timbl commented Aug 16, 2021

This issue may be the underlying issue to SolidOS/solidos#29

@timbl
Copy link
Member Author

timbl commented Aug 16, 2021

From gitter: @jeff-zucker You made a good point in the meeting that, with the Wac-Allow header, we have to be wary of even responses like 200 and 404 which are not to do with authentication errors, as the WAC-Allow status my have changed for 200 (or 404) responses. Its not just 403 and 401 which need to be disregarded.

@angelo-v
Copy link
Contributor

Repopen, since the PR was only about the editable check

@angelo-v angelo-v reopened this Mar 22, 2023
@bourgeoa
Copy link
Contributor

@angelo-v
Copy link
Contributor

With #512 merged the editable check now is working fine. But the fetcher still caches the 401 and 403 responses and will not re-fetch a resource after login unless it is forced. I guess the fetcher should consider the new outOfDate flag when deciding wether to fetch a resource or take it from cache.

@bourgeoa bourgeoa removed a link to a pull request Mar 23, 2023
@bourgeoa bourgeoa linked a pull request Mar 23, 2023 that will close this issue
@bourgeoa bourgeoa linked a pull request Mar 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants