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
Hi Maurits & all,
Would it be possible (what would be the effort level?) to implement a "request transformer" middleware so that we could have a function (executed first among the middlewares) that receives the global Request object as the input, transforms it as desired, and then return a modified (transformed) request object that the API will use from here on for the current process?
This would solve the case of masking (hiding) implementation details of a url route on the client side without resorting to other frameworks / libraries (the last piece of the puzzle for building really nice custom API routes using just this awesome lib).
Example:
On the client, when I click a submit button, I don't want the url to show sensitive data, like real user ids or real column names as they are stored in the database.
I would like to access: api/users/f3xh4hc33a instead of api.php/records/users/3
The API would need to be aware of this request and use if for subsequent operations (and not use the global Request object) from this point on until finishing the current process.
Such function could look something like:
functiontransformRequest ($originalRequest) {
$transformedRequest = $originalRequest;
// ...;// ... split request into parts; // ... transform request parts as required;$transformedRequest.url = '/records/users/3';
$transformedRequest.method = 'POST';
// ...;return$transformedRequest;
}
The text was updated successfully, but these errors were encountered:
Hi Maurits & all,
Would it be possible (what would be the effort level?) to implement a "request transformer" middleware so that we could have a function (executed first among the middlewares) that receives the global Request object as the input, transforms it as desired, and then return a modified (transformed) request object that the API will use from here on for the current process?
This would solve the case of masking (hiding) implementation details of a url route on the client side without resorting to other frameworks / libraries (the last piece of the puzzle for building really nice custom API routes using just this awesome lib).
Example:
On the client, when I click a submit button, I don't want the url to show sensitive data, like real user
id
s or real column names as they are stored in the database.I would like to access:
api/users/f3xh4hc33a
instead ofapi.php/records/users/3
The API would need to be aware of this request and use if for subsequent operations (and not use the global Request object) from this point on until finishing the current process.
Such function could look something like:
The text was updated successfully, but these errors were encountered: