You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion: Have whitelist_client and whitelist_server instead of whitelist #2550
I'm new to feathers, so my suggestion may be the same as #2445
Please close this request if this is the case.
I need to use $populate on the server. I do not want to allow the client to send a query using $populate.
As it is, I need to whitelist $populate in the service so I can use it on the server. This also allows the client to send a query with $populate.
Extra coding has to be done to ensure the client does not send a $populate parameter. I would like to easily not allow the client to use $populate, but still use it on the server.
I actually stumbled up this issue as I was checking if there was already an issue regard what I was about to post. Similar to whitelist supporting multiple providers, it would also be nice if multi did as well. I would like to allow multi on the server but not on the client. Perhaps a better syntax would be
// Keep the old config for backwards compatibility. If the user// passes options like this then the whitelist/multi applies to all providersconstoptions={whitelist: ['$and'],multi: true}// Also allow thisconstoptions={whitelist: {server: [...]// bummer, server is actually provider: undefined,rest: [...],socketio: [...]},multi:{server: true,rest: falsesocketio: false}}
I know this can be done in hooks (and that may be better place), but this is kind of a wishlist item I guess. I will also open an issue in feathers-hooks-common to add some hooks around these two items.
I'm inclined to update #2607 with adding double underscore (not super great naming but I can't think of anything better) hook-less service methods that don't do any sanitizing or validation. So basically you'd have:
_find, _create etc. which validates queries, filters and multi checks and passes the sanitized data to __find, __create etc.
__find, __create which just takes whatever you pass and rolls with it
The reason why all sanitizing is now done in the single-underscored service methods is described in more detail in #2605. Basically I'd like people to be able to extend from the adapters and then implement the actual service methods with whatever types they want (usually just calling the _method in turn).
Activity
BenZed commentedon Mar 18, 2022
Check that there is a provider before eliminating the query param.
DaddyWarbucks commentedon Apr 6, 2022
I actually stumbled up this issue as I was checking if there was already an issue regard what I was about to post. Similar to
whitelistsupporting multiple providers, it would also be nice ifmultidid as well. I would like to allow multi on the server but not on the client. Perhaps a better syntax would beI know this can be done in hooks (and that may be better place), but this is kind of a wishlist item I guess. I will also open an issue in feathers-hooks-common to add some hooks around these two items.
daffl commentedon Apr 25, 2022
I'm inclined to update #2607 with adding double underscore (not super great naming but I can't think of anything better) hook-less service methods that don't do any sanitizing or validation. So basically you'd have:
_find,_createetc. which validates queries, filters andmultichecks and passes the sanitized data to__find,__createetc.__find,__createwhich just takes whatever you pass and rolls with itThe reason why all sanitizing is now done in the single-underscored service methods is described in more detail in #2605. Basically I'd like people to be able to extend from the adapters and then implement the actual service methods with whatever types they want (usually just calling the
_methodin turn).