-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Require token for local editing #34559
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
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]>
|
/backport to stable25 |
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.
👍
| $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
No description provided.