Skip to content

Commit

Permalink
Merge pull request #40295 from nextcloud/appecosystem-renaming
Browse files Browse the repository at this point in the history
Rename AppEcosystemV2 to AppAPI
  • Loading branch information
AndyScherzinger authored Sep 7, 2023
2 parents c08a803 + 01a1164 commit 80a4b36
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build/stubs/app_ecosystem_v2.php → build/stubs/app_api.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace OCA\AppEcosystemV2\Service;
namespace OCA\AppAPI\Service;

use OCP\IRequest;

class AppEcosystemV2Service {
class AppAPIService {
/**
* @param IRequest $request
* @param bool $isDav
Expand Down
12 changes: 6 additions & 6 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ public static function handleLogin(OCP\IRequest $request): bool {
if (OC_User::handleApacheAuth()) {
return true;
}
if (self::tryAppEcosystemV2Login($request)) {
if (self::tryAppAPILogin($request)) {
return true;
}
if ($userSession->tryTokenLogin($request)) {
Expand Down Expand Up @@ -1179,17 +1179,17 @@ protected static function handleAuthHeaders(): void {
}
}

protected static function tryAppEcosystemV2Login(OCP\IRequest $request): bool {
protected static function tryAppAPILogin(OCP\IRequest $request): bool {
$appManager = Server::get(OCP\App\IAppManager::class);
if (!$request->getHeader('AE-SIGNATURE')) {
if (!$request->getHeader('AUTHORIZATION-APP-API')) {
return false;
}
if (!$appManager->isInstalled('app_ecosystem_v2')) {
if (!$appManager->isInstalled('app_api')) {
return false;
}
try {
$appEcosystemV2Service = Server::get(OCA\AppEcosystemV2\Service\AppEcosystemV2Service::class);
return $appEcosystemV2Service->validateExAppRequestToNC($request);
$appAPIService = Server::get(OCA\AppAPI\Service\AppAPIService::class);
return $appAPIService->validateExAppRequestToNC($request);
} catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<file name="build/stubs/zip.php"/>
<file name="build/stubs/psr_container.php"/>
<file name="3rdparty/sabre/uri/lib/functions.php" />
<file name="build/stubs/app_ecosystem_v2.php" />
<file name="build/stubs/app_api.php" />
</stubs>
<issueHandlers>
<LessSpecificReturnStatement errorLevel="error"/>
Expand Down

0 comments on commit 80a4b36

Please sign in to comment.