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
Require token for local editing #34559
Require token for local editing #34559
Conversation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
|
/backport to stable25 |
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.
| $pathHash = sha1($path); | ||
|
|
||
| $entity = new OpenLocalEditor(); | ||
| $entity->setUserId($this->userId); |
Check notice
Code scanning / Psalm
PossiblyNullArgument Note
| $pathHash = sha1($path); | ||
|
|
||
| try { | ||
| $entity = $this->mapper->verifyToken($this->userId, $pathHash, $token); |
Check notice
Code scanning / Psalm
PossiblyNullArgument Note
| */ | ||
| class OpenLocalEditor extends Entity { | ||
| /** @var string */ | ||
| protected $userId; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor Note
| protected $userId; | ||
|
|
||
| /** @var string */ | ||
| protected $pathHash; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor Note
| protected $pathHash; | ||
|
|
||
| /** @var int */ | ||
| protected $expirationTime; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor Note
| protected $expirationTime; | ||
|
|
||
| /** @var string */ | ||
| protected $token; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor Note
| * @throws MultipleObjectsReturnedException | ||
| * @throws Exception | ||
| */ | ||
| public function verifyToken(string $userId, string $pathHash, string $token): OpenLocalEditor { |
Check notice
Code scanning / Psalm
MoreSpecificReturnType Note
| ->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 Note
No description provided.