-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
NEW: Log requests as curl command in log #33757
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
Conversation
5520a26 to
63e3e80
Compare
|
@eldy So awaiting for feedback on if and how you'ld like to see this be integrated, rename the functions, etc. I proposed this in #33722 to help understand the incoming request of the API where this is most useful (generally we have control over the navigator, except when it is a remote user). |
|
Let me understand. |
|
Yes. Could also be applied to web page requests. |
|
Interesting, are you also going to log the token? |
|
As for the api call, could also be a mirror that reflects back what you send it? |
My opinion is that there are already mirror services available on the web. |
This also logs the token as it will be part of the request. |
|
Logging the token could be a security concern, I'd prefer if it was an option to log it or not |
|
@mdeweerd in some debug cases I might want to log all database queries, and since all of them usually goes through |
|
@JonBendtsen I think there is already a means to log sql queries - maybe not the sql results. So logging sql results could be another useful addition to dolibarr. (However not in the scope of this proposal). My experience with logging the HTTP requests (not specifically with Dolibarr), is that the third party is often claiming to do this or that, and the log of exact request identifies what is wrong with it. As for the HTTP request logging (for the API), I would now propose this:
|
|
@mdeweerd have in mind that permissions may not be identical |
Not sure what you mean, but if the developer choses not to log the APIKEY, (s)he should know that. I also suppose (or hope) that APIKEYs (can) expire. |
APIKEYs can get regenerated, as far as I know they do not have an expire date. Each user has some permissions, some can read objects, others can write and perhaps even delete. |
|
Regarding permissions. If in my Dolibarr have different permissions than you do, then the results in the GUI and API may very well be different. |
|
@mdeweerd i think having these curl commands would make it easier to build up a series of tests that easily can be repeated |
That is a good idea. |
55c4f5c to
42450c8
Compare
And then I started using hurl.dev which is not really curl, but maybe the logged curl commands can automatically be transcribed to hurl.dev tests? |
42450c8 to
c0476d8
Compare
|
@JonBendtsen The question remains what the preferred method is to activate it (and test it, I did not test). One method to activate it could be to add a |
fae771a to
63bb1ec
Compare
|
@JonBendtsen This is what the output now looks like (the option to capture the output is not enabled): |
# NEW: Log requests as curl command in log This adds a feature to log the HTTP(s) requests as a curl command in in the log. This allows: - Getting *all* the information on a request (headers/payload/...); - Repeating requests; - Making better bug reports or requests for help.
acd6d7c to
df661e3
Compare
|
Closed as draft since a too long time |
|
@eldy I was kind of waiting for your feedback as well which I suppose is in your decision to close this PR. |
I may have missed something. |
|
@eldy So where/when should we log as curl (when to call the function, environment variable (new or reuse), setting, based on $_GET parameter (not ok for security), etc). |
NEW: Log requests as curl command in log
This adds a feature to log the HTTP(s) requests as a curl command in in the log.
This allows: