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

Draft: Add "pwg.getConfig" WS method #2216

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mistic100
Copy link
Member

@mistic100 mistic100 commented Aug 30, 2024

To be discussed.

I try to start working on my PWA based on Piwigo WS and am in need of some configuration parameters of the server.

  • I personally only need behavior parameters, thus everything directly related to the UI is not exposed, though the new method could have a parameter to choose what to get (general, ui, all ... ?)

  • These parameters should not have any security impact, but if more are exposed, a test of the user role will be needed for some of them

@plegall
Copy link
Member

plegall commented Nov 7, 2024

While I find the idea to be able to fetch the configuration with an API call, I'm absolutely not comfortable to provide such information for "anyone who ask". At the very least it should be "admin only". I would even prefer a "webmaster only" filter.

@mistic100
Copy link
Member Author

mistic100 commented Nov 7, 2024

In my case, the parameters I listed need to be "public". Those are only parameters related to the UI, how many comments to display, is the rating widget enabled, etc. If it is for admin/webmaster only, it is useless.

One should ask "what can I do with this information ?", and because in the end, the backend is doing all the necessary checks for each API call (like adding a comment or a rating), the answer is "nothing".

Which is not the case for every parameters of course. That's why I proposed to add a role check if we want to expose more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants