-
Notifications
You must be signed in to change notification settings - Fork 24
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
URLs with expired sharing token prevent logged in users from editing #7309
Comments
The tracingstore auth always uses a token, cookies are not sent there. I think the frontend decides which token to send (probably the uri token has precedence). I see a couple of options to fix this
@philippotto do you have opinions on this? I guess 2 is the most viable option. There are certainly also other ways of solving this that I couldn’t think of just now |
TLDR: A mix of 2 and 3 would probably work. At first, I thought, (3) is the easiest, because we already have a token-retry mechanism. Currently, that mechanism is only used for non-url tokens (which have precedence as you assumed correctly), but it could easily be expanded, so that url tokens are replaced by user tokens. Then, I noticed the following problem: A potential solution for this would be to let the front-end know that the url token is really expired (this means the token is absolutely worthless and can be discarded). Either this is done by setting a special response header (or is there a dedicated status code?) OR by having a separate route which can be asked about this. What do you think? |
Yeah, sounds about right. For the backend side it would certainly be easier to add another route so that the frontend can query this expired-ness. But it would also be feasible to introduce another status code or header in this case. I’d have to think about how to propagate that info from the webknossos backend to the datastore and tracingstore so that they can reply with that specific status. |
Then, let's do this. The front-end can query that route in case the url-token causes 403s. I think, that's fine :) Should be rare enough to justify the extra request. |
Context
Someone shared a WK shortened link to an annotation with me. The annotation URL contains an (expired) token. Since I was logged in, I was able to open the annotation nonetheless. In this particular case the annotation was "shared" and I wanted to edit it. WK wrongly assumed I can not make any changes since the token was expired. I get a lot of warnings.
A likely fix could be that WK checks whether one has access to an annotation regardless if the URL has a token or not.
Expected Behavior
I should be able to edit any annotation that my user has access rights to regardless through which URL I opened it from.
Current Behavior
A (team)-shared annotation open from a shortened WK link (e.g. https://webknossos.org/links/abc) including a expired token does not let me make any changes.
Steps to Reproduce the bug
Your Environment for bug
jobsEnabled=true
inapplication.conf
)isDemoInstance=true
inapplication.conf
)The text was updated successfully, but these errors were encountered: