-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable25] Require token for local editing #34564
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
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
| $pathHash = sha1($path); | ||
|
|
||
| $entity = new OpenLocalEditor(); | ||
| $entity->setUserId($this->userId); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
| $pathHash = sha1($path); | ||
|
|
||
| try { | ||
| $entity = $this->mapper->verifyToken($this->userId, $pathHash, $token); |
Check notice
Code scanning / Psalm
PossiblyNullArgument
| */ | ||
| class OpenLocalEditor extends Entity { | ||
| /** @var string */ | ||
| protected $userId; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor
| protected $userId; | ||
|
|
||
| /** @var string */ | ||
| protected $pathHash; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor
| protected $pathHash; | ||
|
|
||
| /** @var int */ | ||
| protected $expirationTime; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor
| protected $expirationTime; | ||
|
|
||
| /** @var string */ | ||
| protected $token; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor
| * @throws MultipleObjectsReturnedException | ||
| * @throws Exception | ||
| */ | ||
| public function verifyToken(string $userId, string $pathHash, string $token): OpenLocalEditor { |
Check notice
Code scanning / Psalm
MoreSpecificReturnType
| ->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter($pathHash))) | ||
| ->andWhere($qb->expr()->eq('token', $qb->createNamedParameter($token))); | ||
|
|
||
| return $this->findEntity($qb); |
Check notice
Code scanning / Psalm
LessSpecificReturnStatement
|
@nickvergessen backport incomplete |
Signed-off-by: Joas Schilling <[email protected]>
|
Version in info.xml was the issue, so bumped it manually. |
PVince81
left a comment
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.
👍
backport of #34559