mirror of
https://github.com/plankanban/planka.git
synced 2026-02-05 00:39:58 +03:00
[Bug]: getUser endpoint regex is failing?
#898
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hwelch-fle on GitHub (Jan 19, 2026).
Where is the problem occurring?
I encountered the problem while interacting with the server (Backend)
What browsers are you seeing the problem on?
Other
Current behavior
When calling the
getUserendpoint, a400error is thrown even when the user requesting the info is admin:plankapy code directly accessing the endpoint:
Not totally sure why this is happening since when I test the regex
^[1-9][0-9]*$|^meit correctly captures ids andme.This is the only endpoint that fails the id regex check that I've seen so far.
Additionally, when accessing
methe regex always passes:I am also interested in how one would get User info when not logged in as an admin, since the current endpoints seems to only allow admins and board managers to access User info directly. All other users need to get user info by inspecting the
includedattributes of cards and boards. This is fine, but it also means that lower permission users can't get updated user info without querying cards.Desired behavior
Explained above
Steps to reproduce
send a
GETrequest to/api/users/{:id}with a userIdOther information
No response
@hwelch-fle commented on GitHub (Jan 19, 2026):
Currently, my solution to get user info on cards is to check bottom up, but having an endpoint that can get even just a user's
nameattribute from an id would save some load:Current:
Better?
Or one that requires passing a board so
currentUserBoard Membership can be checked:@meltyshev commented on GitHub (Jan 19, 2026):
Hey! Regarding the regex - we fixed that, the wrong regex was specified in validation: https://github.com/plankanban/planka/issues/1302.
If you're actively testing things with plankapy, I suggest using the
nightlyversion (until the final release appears) - a lot of issues should be resolved, and there are new features added, like ability to link tasks to cards and more (should be also described in the Swagger spec, but won't work with justrc.4version). We're trying to finish everything faster to get a release out already - things, as always, got delayed...And regarding fetching a user - we did that on purpose, so only admins and project owners can access and fetch any user info, while regular board members only see the available ones. I tried to implement fetching a user by id for a regular role, but it was a bit tricky to calculate all the available ids to prevent unpermitted access. I understand this isn't the best approach in terms of API usage - I'll try to fix that somehow :)
For now, the temporary solution should be fine until we implement proper by-id fetching. The only issue I see with this approach is that comments can reference user ids that are no longer on the board or even deleted (null), but the endpoint for fetching comments should include all users presented.
@hwelch-fle commented on GitHub (Jan 20, 2026):
Gotcha! I'm currently running the lastest
rc4release using Docker. So I'll change that.Yeah, implementing the interface in plankapy really reveals all the annoying little nuisances that come with permissions. I'm currently letting everything fail pretty hard and just raise the raw
HTTPErrorfor testing. There's a couple places where I've implemented checks oncurrent_userby storingme.idandme.roleafter logon.The biggest hurdle for me now is deciding how to handle caching. All objects maintain endpoint binds and attribute access currently hits the local cache until
syncis called (if aGETendpoint exists). All attribute writes update the local instance cache, and allincludedhit the providedGETendpoint on access.I'm okay with this being a bit slow for now since it's primarily meant to automate manual tasks that would take forever anyways.
The interface alone is up to 3000 lines lol. Lot of boilerplate, but also a ton of functionality that lets you manage and traverse a Planka instance using list comprehensions.