-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fixes for legacy solid apps (poddit launcher in solid-nextcloud) #140
Conversation
use Pdsinterop\Solid\Auth\Utils\Bearer; | ||
use Pdsinterop\Solid\Auth\Utils\JtiValidator; | ||
|
||
trait BearerFactoryTrait |
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.
👍
@@ -304,13 +306,28 @@ public function handleRequest($userId, $path) { | |||
|
|||
$dpop = $this->getDpop(); | |||
|
|||
$error = false; |
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.
Error is set here (and below) but doesn't seem to be used anywhere?
try { | ||
$webId = $dpop->getWebId($request); | ||
} catch(\Pdsinterop\Solid\Auth\Exception\Exception $e) { | ||
$error = $e; |
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.
Not sure, think this might be more readable/understandable?
$error = false;
try {
$webId = $dpop->getWebId($request);
} catch(\Pdsinterop\Solid\Auth\Exception\Exception $e) {
$bearer = $this->getBearer();
try {
$webId = $bearer->getWebId($request);
} catch(\Pdsinterop\Solid\Auth\Exception\Exception $e) {
$error = $e;
}
}
if ($error instanceof \Pdsinterop\Solid\Auth\Exception\Exception) {
$response = $this->resourceServer->getResponse()
->withStatus(Http::STATUS_CONFLICT, "Invalid token");
return $this->respond($response);
}
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.
Nothing functionally wrong, I have a stylistic question regarding the changes in the Storage control. The code is good, so feel free to merge as-is if you feel changes are not needed.
Love the BearerFactoryTrait
, by the way.
provide functions to list and remove client registrations
Adds fixes to get the poddit launcher working. Depends on pdsinterop/php-solid-auth#40