-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support signed urls #37634
Support signed urls #37634
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
4c6c090
to
e04d2b8
Compare
Codecov Report
@@ Coverage Diff @@
## master #37634 +/- ##
============================================
- Coverage 64.74% 64.71% -0.04%
- Complexity 19360 19383 +23
============================================
Files 1281 1283 +2
Lines 75622 75724 +102
Branches 1333 1333
============================================
+ Hits 48959 49001 +42
- Misses 26271 26331 +60
Partials 392 392
Continue to review full report at Codecov.
|
@@ -230,7 +236,7 @@ private function auth(RequestInterface $request, ResponseInterface $response) { | |||
$this->checkAccountModule($user); | |||
$uid = $user->getUID(); | |||
\OC_Util::setupFS($uid); | |||
$this->currentUser = $uid; | |||
$currentUser = $uid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see $currentUser
being used anywhere (neither was there a $this->currentUser
to begin with). Remove completely?
e04d2b8
to
6c2c952
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor picky stuff.
Otherwise this looks good from the code perspective, I haven't tested 👍
@@ -192,6 +192,7 @@ public function lock($uri, Locks\LockInfo $lockInfo) { | |||
|
|||
// in case the timeout has not been accepted, adjust in lock info | |||
$lockInfo->timeout = $lock->getTimeout(); | |||
$lockInfo->owner = $lock->getOwner(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR mix up ?
} | ||
} | ||
|
||
public function providesUrls() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add cases where some of the required attrs are missing
return $this->request->getQueryParameters(); | ||
} | ||
|
||
public function getUserId(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to getUrlCredential
for consistency ? everywhere you used it you always stored it in a var getUrlCredential
. or alternatively rename those vars to $userId
?
6c2c952
to
db2cad6
Compare
codecov is nuts .... most likly because of the rebase ..... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me.
db2cad6
to
9377864
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All fine, just some minor text change 👍
protected function configure() { | ||
$this | ||
->setName('security:sign-key:create') | ||
->setDescription('Create and recreate a users sign key for signed urls') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Create or recreate a users signing key"
"sign key" doesn't sound good, I believe it should be "signing key" as it's used for signing
} | ||
$signingKey = $this->config->getUserValue($uid, 'core', 'signing-key', null); | ||
if ($signingKey !== null) { | ||
$output->writeln('This user already has a sign key. Recreating the key will invalidate all existing signed urls.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"signing key"
9377864
to
e32cbef
Compare
@DeepDiver1975 Why was this merged without a changelog? |
Description
Related Issue
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: