Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


return [
'ocs' => [
['name' => 'Slave#createAppToken', 'url' => '/v1/createapptoken', 'verb' => 'GET'],
Expand Down
4 changes: 0 additions & 4 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
}


/**
* @param IRegistrationContext $context
*/
Expand Down Expand Up @@ -103,7 +102,6 @@ function (GenericEvent $event) {
);
}


/**
* @param IBootContext $context
*
Expand All @@ -118,7 +116,6 @@ public function boot(IBootContext $context): void {
$context->injectFn(Closure::fromCallable([$this, 'redirectToMasterLogin']));
}


/**
* Register the Global Scale User Backend if we run in slave mode
*/
Expand Down Expand Up @@ -146,7 +143,6 @@ private function registerUserBackendForSlave() {
$this->logger->debug('gss UserBackend registered', ['app' => self::APP_ID]);
}


/**
* Register the Global Scale User Backend if we run in slave mode
*/
Expand Down
1 change: 1 addition & 0 deletions lib/BackgroundJobs/UpdateLookupServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\BackgroundJobs;

use OCA\GlobalSiteSelector\GlobalSiteSelector;
Expand Down
1 change: 1 addition & 0 deletions lib/Command/GlobalScaleDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\Command;

use OC\Core\Command\Base;
Expand Down
2 changes: 0 additions & 2 deletions lib/Command/UsersUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function __construct(Slave $slave) {
$this->slave = $slave;
}


/**
*
*/
Expand All @@ -34,7 +33,6 @@ protected function configure() {
->setDescription('update known users data to Lookup Server');
}


/**
* @param InputInterface $input
* @param OutputInterface $output
Expand Down
1 change: 1 addition & 0 deletions lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector;

use OCP\Config\Lexicon\Entry;
Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/MasterController.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?php


/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


namespace OCA\GlobalSiteSelector\Controller;

use OCA\GlobalSiteSelector\AppInfo\Application;
Expand Down
3 changes: 0 additions & 3 deletions lib/Controller/SlaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


namespace OCA\GlobalSiteSelector\Controller;

use OC\Authentication\Token\IProvider;
Expand Down Expand Up @@ -125,7 +124,6 @@ public function sharedFile(string $jwt): DataResponse {
}
}


#[PublicPage]
#[NoCSRFRequired]
#[UseSession]
Expand Down Expand Up @@ -300,7 +298,6 @@ protected function decodeJwt($jwt) {
return [$uid, $password, json_decode($options, true)];
}


/**
* create new user if the user doesn't exist yet on the client node
*
Expand Down
4 changes: 0 additions & 4 deletions lib/GlobalSiteSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class GlobalSiteSelector {
public const MASTER = 'master';
public const SLAVE = 'slave';


/** @var IConfig */
private $config;

Expand Down Expand Up @@ -59,7 +58,6 @@ public function isSlave(): bool {
return ($this->getMode() === self::SLAVE);
}


/**
* get JWT key
*
Expand All @@ -70,7 +68,6 @@ public function getJwtKey(): string {
return $this->config->getSystemValueString('gss.jwt.key', '');
}


/**
* get the URL of the global site selector master
*
Expand All @@ -86,7 +83,6 @@ public function getMasterUrl(): string {
return $masterUrl;
}


/**
* get lookup server URL
*
Expand Down
1 change: 0 additions & 1 deletion lib/Listeners/UserCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function __construct(
) {
}


/**
* @param Event $event
*/
Expand Down
1 change: 0 additions & 1 deletion lib/Listeners/UserDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function __construct(
) {
}


/**
* @param Event $event
*/
Expand Down
2 changes: 0 additions & 2 deletions lib/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ public function getUserLocation(string $address, string &$uid = ''): string {
}
}


private function getUserLocation_Validate(string $address): string {
try {
$cloudId = $this->cloudIdManager->resolveCloudId($address);
Expand Down Expand Up @@ -133,7 +132,6 @@ private function getUserLocation_Ignore(string $address, ?string &$uid = ''): st
return rtrim($url, '/');
}


/**
* based on the sanitizeUsername() method from apps/user_ldap/lib/Access.php
*
Expand Down
1 change: 1 addition & 0 deletions lib/Model/LocalFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\Model;

use JsonSerializable;
Expand Down
1 change: 1 addition & 0 deletions lib/Model/LocalMount.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\Model;

use JsonSerializable;
Expand Down
1 change: 1 addition & 0 deletions lib/Service/GlobalScaleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\Service;

use Exception;
Expand Down
4 changes: 1 addition & 3 deletions lib/Service/GlobalShareService.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\GlobalSiteSelector\Service;

use Exception;
Expand Down Expand Up @@ -50,7 +51,6 @@ public function __construct(
) {
}


/**
* @return int|null NULL if file not fount
*/
Expand Down Expand Up @@ -98,7 +98,6 @@ public function getNewFileId(string $token, int $fileId): ?int {
return $this->getSharedFileRemoteDetails($instance, $fileId);
}


/**
* @param string|null $instance set to NULL when assuming local
* @return FederatedShare[]
Expand Down Expand Up @@ -141,7 +140,6 @@ public function getSharedFiles(int $fileId, int $shareId = 0, ?string $instance
return $this->shareRequest->getFederatedSharesRelatedToRemoteInstance($files, $instance);
}


/**
* get details about a shared remote file based on the address of the remote
* instance and the id of the file as stored on that remote instance
Expand Down
8 changes: 0 additions & 8 deletions lib/Service/SlaveService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


namespace OCA\GlobalSiteSelector\Service;

use Exception;
Expand Down Expand Up @@ -64,7 +63,6 @@ public function __construct(
$this->cacheDisplayNameTtl = ($ttl === 0) ? self::CACHE_DISPLAY_NAME_TTL : $ttl;
}


public function updateUserById(string $userId): void {
$user = $this->userManager->get($userId);
if (is_null($user)) {
Expand All @@ -89,7 +87,6 @@ public function updateUser(IUser $user): void {
$this->updateUsersOnLookup($userData);
}


/**
* get single user's display name
*
Expand Down Expand Up @@ -166,7 +163,6 @@ protected function getDetails(array $users, bool $cacheOnly = false): array {
return array_merge($knownDetails, $details);
}


protected function updateUsersOnLookup(array $users): void {
$this->logger->debug(
'Batch updating users: {users}',
Expand All @@ -176,7 +172,6 @@ protected function updateUsersOnLookup(array $users): void {
$this->postLookup('/gs/users', ['users' => $users]);
}


protected function postLookup(string $path, array $data): void {
try {
$this->checkConfiguration();
Expand All @@ -200,7 +195,6 @@ protected function postLookup(string $path, array $data): void {
}
}


/**
* @param string $path
* @param array $data
Expand Down Expand Up @@ -231,7 +225,6 @@ protected function getLookup(string $path, array $data): string {
return $response->getBody();
}


/**
* @return void
* @throws ConfigurationException
Expand All @@ -250,7 +243,6 @@ protected function checkConfiguration(): void {
}
}


/**
* get user data from account manager
*
Expand Down
2 changes: 0 additions & 2 deletions lib/Slave.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


namespace OCA\GlobalSiteSelector;

use Exception;
Expand Down Expand Up @@ -34,7 +33,6 @@ class Slave {
private IConfig $config;
private static array $toRemove = []; // remember users which should be removed


public function __construct(
IUserManager $userManager,
IClientService $clientService,
Expand Down
6 changes: 0 additions & 6 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public function __construct(
) {
}


/**
* Backend name to be shown in user management
*
Expand Down Expand Up @@ -166,7 +165,6 @@ public function getUsers($search = '', $limit = null, $offset = null): array {
return $uids;
}


/**
* counts the users in the database
*
Expand Down Expand Up @@ -313,7 +311,6 @@ public function isSessionActive(): bool {
return ($this->getCurrentUserId() !== '');
}


/**
* Return the id of the current user
*
Expand All @@ -332,7 +329,6 @@ public function getCurrentUserId(): string {
return '';
}


/**
* Check if the provided token is correct
*
Expand Down Expand Up @@ -387,7 +383,6 @@ public function registerBackends(array $backends): void {
}
}


public function updateAttributes(string $uid, array $attributes): void {
$user = $this->userManager->get($uid);

Expand Down Expand Up @@ -447,7 +442,6 @@ public function updateAttributes(string $uid, array $attributes): void {
}
}


/**
* Whether $uid exists in the database
*
Expand Down
1 change: 0 additions & 1 deletion lib/UserDiscoveryModules/ManualUserMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function __construct(
$this->logger->debug('use regular expression: ' . ($this->useRegularExpressions ? 'true' : 'false'));
}


/**
* get the initial user location
*
Expand Down
1 change: 0 additions & 1 deletion lib/UserDiscoveryModules/UserDiscoveryOIDC.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public function __construct(IConfig $config) {
$this->tokenLocationAttribute = $config->getSystemValueString('gss.discovery.oidc.slave.mapping', '');
}


/**
* read user location from OIDC token attribute
*
Expand Down
1 change: 0 additions & 1 deletion lib/UserDiscoveryModules/UserDiscoverySAML.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function __construct(IConfig $config) {
$this->idpParameter = $config->getSystemValueString('gss.discovery.saml.slave.mapping', '');
}


/**
* read user location from SAML parameters
*
Expand Down
1 change: 0 additions & 1 deletion tests/unit/lib/Controller/SlaveControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


namespace OCA\GlobalSiteSelector\Tests\Unit\Controller;

use OC\Authentication\Token\IProvider;
Expand Down
Loading
Loading