-
Notifications
You must be signed in to change notification settings - Fork 30
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
Zotero Integration: Scope "Connect Web Library" access to that of API key #667
Comments
To be complete regarding the step you took, why did you choose for Default Group Permissions ?
I think we need to have a bit more information about your Zotero library setup and group. I am just not sure how to setup a Zotero library to test this in your specific usage. Did you try to look in VSCODE logging to see if there are more information about the function / step that is throwing the unauthorized ? I am no expert in VSCODE extension debugging but maybe there are more info that would help be sure of which is the wrong request. You could also help us understand the problem by using your API key with an external client For groups we are using the endpoint: quarto/packages/editor-server/src/core/zotero/web/groups.ts Lines 55 to 58 in 57ed6fb
quarto/packages/editor-server/src/core/zotero/web/api.ts Lines 135 to 137 in 57ed6fb
Doc says:
Could the last part be the problem ? We iterate on all those group after quarto/packages/editor-server/src/core/zotero/web/groups.ts Lines 67 to 70 in 57ed6fb
quarto/packages/editor-server/src/core/zotero/web/api.ts Lines 139 to 142 in 57ed6fb
for this we use the endpoint We do not seem to handle owner groups where the API key does not have access explicitly. And also we do not seem to query only the groups from the configuration... Using your key with another lib like Hope this helps understand current problem. Thanks a lot for the feedback ! |
Thank you for your quick response!
In my scenario, the Default Group Permissions is "None", since the API key should not allow access to any "current or future groups" except the one specifically mentioned in "Specific Groups". In "Specific Groups", I have given the Key "Read Only" permission to the group.
Unfortunately, the only thing I can see is the error message. For a key that is only scoped to the group that is to be shared, I get
Yes, that is probably it. Although I thought that the Zotero API would automatically exclude all libraries that a key does not grant access to. An easy solution would be to not fail when "unauthorized" errors are thrown, but simply log warnings. A more comprehensive solution of course would query which libraries the key has access to and only sync those. But I would be happy with the one that warns instead of throws on forbidden access.
When I query https://api.zotero.org/keys/XXXXX , with XXXXX being the key that has only access to the group, I get {
"key": "<the key>",
"userID": <my user id>,
"username": "<my user name>",
"displayName": <my display name>",
"access": {
"groups": {
"<the group id>": {
"library": true,
"write": false
}
}
} For constrast, here is the response to a key that has access to everything: {
"key": "<the key>",
"userID": <my user id>,
"username": "<my user name>",
"displayName": <my display name>",
"access": {
"user": {
"library": true,
"files": true
},
"groups": {
"all": {
"library": true,
"write": false
}
}
}
} So it would be wonderful if the sync algorithm would use the "access" field of the json response to the |
I don't find any use of This is bigger change that just handling unauthorized access knowing that Thanks a lot for the aditional information. That will really help us |
Bug description
I want to collaboratively work on a .qmd file using a shared Zotero group library. I have generated an API Key scoped to that library with only read access, which I want to share with my collaborators. However, it seems Quarto expects an API key with access to all of the groups and the user library, which is not what I want.
Steps to reproduce
Actual behavior
I get an "unauthorized access" error for other group libraries which I do not want to share, and for the main user library, which I also do not want to share.
Expected behavior
Only the library/libraries specified in "Quarto › Zotero: Group Libraries" are accessed any synchronized.
Your environment
VS Code:
Version: 1.96.4 (user setup)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.19045
Quarto Version 1.118.0
The text was updated successfully, but these errors were encountered: