Skip to content
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

Respect mod_unique_id and refactor OC_Request::getRequestId #13973

Merged
merged 1 commit into from
Feb 9, 2015

Conversation

LukasReschke
Copy link
Member

When mod_unique_id is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs.

Testplan:

  • When mod_unique_id is enabled the request ID equals the one generated by mod_unique_id.
  • When mod_unique_id is not available the request ID is a 20 character long random string
  • The generated Id is stable over the lifespan of one request

Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI.

Fixes #13366

@MorrisJobke @PVince81 Please review.

When `mod_unique_id` is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs.

Testplan:

- [ ] When `mod_unique_id` is enabled the request ID equals the one generated by `mod_unique_id`.
- [ ] When `mod_unique_id` is not available the request ID is a 20 character long random string
- [ ] The generated Id is stable over the lifespan of one request

Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI.

Fixes #13366
@LukasReschke
Copy link
Member Author

@owncloud-bot Retest this please

@DeepDiver1975
Copy link
Member

Look good thx 👍

@ghost
Copy link

ghost commented Feb 9, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/9019/
Test PASSed.

@DeepDiver1975
Copy link
Member

Feel free to submit more prs to kill oc_request completely.

@LukasReschke
Copy link
Member Author

Feel free to submit more prs to kill oc_request completely.

With pleasure. – Let's get this in first though to prevent merge fuckups. I didn't want to mix new features with refactoring in one PR.

@nickvergessen Care to review as well?

@LukasReschke LukasReschke mentioned this pull request Feb 9, 2015
@ghost
Copy link

ghost commented Feb 9, 2015

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/9023/
Test PASSed.

@scrutinizer-notifier
Copy link

The inspection completed: 6 new issues, 3 updated code elements

'method' => 'hi',
)
],
$this->getMockBuilder('\OCP\Security\ISecureRandom')->getMock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is equal to $this->getMock('\OCP\Security\ISecureRandom') just as a hint.

@nickvergessen
Copy link
Contributor

Looks good 👍

LukasReschke added a commit that referenced this pull request Feb 9, 2015
Respect `mod_unique_id` and refactor `OC_Request::getRequestId`
@LukasReschke LukasReschke merged commit 47c7eb4 into master Feb 9, 2015
@LukasReschke LukasReschke deleted the enhancement/security/13366 branch February 9, 2015 16:35
LukasReschke added a commit that referenced this pull request Feb 10, 2015
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes #13976 which was requested in #13973 (comment)
LukasReschke added a commit that referenced this pull request Feb 11, 2015
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes #13976 which was requested in #13973 (comment)
LukasReschke added a commit that referenced this pull request Feb 16, 2015
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes #13976 which was requested in #13973 (comment)
@drzraf
Copy link

drzraf commented May 14, 2016

From the Git history, this commit introduced HTTP_X_OC_MTIME for the first time but there is no rational for it.
For example, why Last-Modified header hasn't been chosen over a new custom HTTP extension?
(it would have been a much more standard way to preserve timestamps of uploaded files?)

@PVince81
Copy link
Contributor

@drzraf I don't see any reference of "OC_MTIME" in this diff, maybe you commented on the wrong PR ? I suggest you make a new ticket to discuss this.
From what I remember, X-OC-MTIME was introduced to tell the desktop client whether the mtime was accepted by the server/storage. Some storages don't support touch operations and for some reason the client needs to know about this. Not sure whether it is still needed nowadays, so a ticket to discuss this would be nice 😄

@drzraf
Copy link

drzraf commented May 17, 2016

commt 886bda5

Fixes #13976 which was requested in #13973 (comment)

Still I don't see documentation about timestamp preservation and how one is expected to touch files.
AFAICT there is no such "touch" thing in the webdav protocol, nor in lftp, ftp or cadaver clients.
I'll open an issue about this.

@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect request ID from mod_unique_id when installed for the oC Request ID
6 participants