Skip to content
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

AppEcosystem Authentification #39655

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
// slash which is required by URL generation.
if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] === \OC::$WEBROOT &&
substr($_SERVER['REQUEST_URI'], -1) !== '/') {
header('Location: '.\OC::$WEBROOT.'/');

Check failure on line 206 in lib/base.php

View workflow job for this annotation

GitHub Actions / static-code-analysis-security

TaintedHeader

lib/base.php:206:12: TaintedHeader: Detected tainted header (see https://psalm.dev/256)
exit();
}
}
Expand Down Expand Up @@ -285,7 +285,7 @@
throw new Exception('Not installed');
} else {
$url = OC::$WEBROOT . '/index.php';
header('Location: ' . $url);

Check failure on line 288 in lib/base.php

View workflow job for this annotation

GitHub Actions / static-code-analysis-security

TaintedHeader

lib/base.php:288:12: TaintedHeader: Detected tainted header (see https://psalm.dev/256)
}
exit();
}
Expand Down Expand Up @@ -1138,6 +1138,9 @@
if (OC_User::handleApacheAuth()) {
return true;
}
if (self::tryAppEcosystemV2Login($request)) {
return true;
}
if ($userSession->tryTokenLogin($request)) {
return true;
}
Expand Down Expand Up @@ -1175,6 +1178,18 @@
}
}
}

protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
$appManager = Server::get(OCP\App\IAppManager::class);
if (!$request->getHeader('AE-SIGNATURE')) {
return false;
}
if (!$appManager->isInstalled('app_ecosystem_v2')) {
return false;
}
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);

Check failure on line 1190 in lib/base.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedClass

lib/base.php:1190:40: UndefinedClass: Class, interface or enum named OCA\AppEcosystemV2\Service\AppEcosystemV2Service does not exist (see https://psalm.dev/019)
Fixed Show fixed Hide fixed
return $appEcosystemV2Service->validateExAppRequestToNC($request);
}
}

OC::init();
Loading