Repository navigation
Chore: stop using our API internally - #1683
Conversation
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
|
If you want to ensure the same auth mechanism as before, shouldn't the InternalAPI be replaced with ajax calls rather than having the UI views bypass the API? |
|
I guess we can get there one day if we want. But the way there is still long. We already did a lot of work, but need to focus. This can be done rather fast, and it is needed now as new potential community members are blocked. Also, we have still one auth layer, everything is done via |
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… before edit test Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… page for a user, one new service utility now shared by API and UI views, removed mocks from tests Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…ures/flexmeasures into chore/stop-using-API-internally
Muhammad-Moiz626
left a comment
There was a problem hiding this comment.
Overall the UI does not seem to be breaking for me as I went through the pages by clicking around and creating/editing/deleting sensors as well.
Thanks. |
Muhammad-Moiz626
left a comment
There was a problem hiding this comment.
Overall the code looks good to me with one small comment. Otherwise I'm okay with merging it.
…h functions which use this already do their own check_access() call. Signed-off-by: Nicolas Höning <nicolas@seita.nl>
… passwords on a GET, and check access on UI pages On 1.0.x, GET /assets/delete_with_data/<id> deleted any asset, with its data, for any logged-in user, as it called the asset service without the permission check the API does (since #1683, in v0.28.0). The asset page's delete button and the reset-password buttons now call the API instead, and the UI routes that acted on a GET are gone, so a link on another site cannot trigger them either. The sensor page, the user audit log page and the page listing an organisation's assets now check access, and the account audit log page follows the audit log's own access rule, as on main. See GHSA-vmgf-59hm-j9m7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v5ELzmj2eBM1L4GTBz Signed-off-by: F.N. Claessen <claessen@seita.nl>
Description
Stop calling the API from Python (UI views). It was confusing and can cause ghost bugs (see issue).
InternalApiclass altogetherdocumentation/changelog.rstLook & Feel
The pages should still feel the same.
Only on the /users/ID endpoint, we are fixing an unnecessarily strong restriction: we are actually allowing other people than just admins to view it. This enables consultants to actually load user pages.
How to test
Click around, run the tests.
Think: do we do the authorization well / as good as before?
Further Improvements
...
Related Items
Closes #1682