Skip to content

Commit

Permalink
Merge pull request #171 from nextcloud/upgrade-composer
Browse files Browse the repository at this point in the history
composer upgrade
  • Loading branch information
ArtificialOwl authored Feb 17, 2025
2 parents 9b1d533 + 16d16de commit 7cc50fc
Show file tree
Hide file tree
Showing 38 changed files with 756 additions and 649 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"classmap-authoritative": true,
"autoloader-suffix": "GlobalSiteSelector",
"platform": {
"php": "8.0"
"php": "8.2"
},
"sort-packages": true
},
Expand Down
62 changes: 33 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/BackgroundJobs/UpdateLookupServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(
ITimeFactory $time,
IConfig $config,
private GlobalSiteSelector $globalSiteSelector,
private Slave $slave
private Slave $slave,
) {
parent::__construct($time);

Expand Down
2 changes: 1 addition & 1 deletion lib/Command/UsersUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(Slave $slave) {
protected function configure() {
parent::configure();
$this->setName('globalsiteselector:users:update')
->setDescription('update known users data to Lookup Server');
->setDescription('update known users data to Lookup Server');
}


Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/MasterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
ISession $session,
GlobalSiteSelector $globalSiteSelector,
Master $master,
LoggerInterface $logger
LoggerInterface $logger,
) {
parent::__construct($appName, $request);

Expand Down
7 changes: 4 additions & 3 deletions lib/Controller/SlaveController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -86,7 +87,7 @@ public function autoLogin(string $jwt): RedirectResponse {
}

try {
list($uid, $password, $options) = $this->decodeJwt($jwt);
[$uid, $password, $options] = $this->decodeJwt($jwt);
$this->logger->debug('uid: ' . $uid . ', options: ' . json_encode($options));

$target = $options['target'];
Expand Down Expand Up @@ -162,15 +163,15 @@ public function createAppToken($jwt) {
}

try {
list($uid, $password, $options) = $this->decodeJwt($jwt);
[$uid, $password, $options] = $this->decodeJwt($jwt);
$saml = (($options['backend'] ?? '') === 'saml');
if ($saml) {
$this->autoprovisionIfNeeded($uid, $options);
}

if ($this->userManager->userExists($uid)) {
// if we have a password, we verify it; if not it means we should be using saml.
$result = ('' === $password) ? $saml : $this->userSession->login($uid, $password);
$result = ($password === '') ? $saml : $this->userSession->login($uid, $password);
if ($result) {
$token = $this->tokenHandler->generateAppToken($uid);

Expand Down
2 changes: 1 addition & 1 deletion lib/GlobalSiteSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GlobalSiteSelector {
public const SLAVE = 'slave';


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

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/AddContentSecurityPolicyListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AddContentSecurityPolicyListener implements IEventListener {
public function __construct(
private IConfig $config,
private IUserSession $userSession,
private IRequest $request
private IRequest $request,
) {
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Listeners/DeletingUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class DeletingUser implements IEventListener {

public function __construct(
private GlobalSiteSelector $globalSiteSelector,
private Slave $slave) {
private Slave $slave,
) {
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/UserDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserDeleted implements IEventListener {

public function __construct(
private GlobalSiteSelector $globalSiteSelector,
private Slave $slave
private Slave $slave,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/UserLoggedOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class UserLoggedOut implements IEventListener {

public function __construct(
private GlobalSiteSelector $globalSiteSelector,
private Slave $slave
private Slave $slave,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/UserLoggingIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UserLoggingIn implements IEventListener {
public function __construct(
private GlobalSiteSelector $globalSiteSelector,
private Master $master,
private LoggerInterface $logger
private LoggerInterface $logger,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(
private IClientService $clientService,
private LoggerInterface $logger,
private ICloudIdManager $cloudIdManager,
private IConfig $config
private IConfig $config,
) {
$this->lookupServerUrl = $this->config->getSystemValueString('lookup_server', '');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
IRequest $request,
IClientService $clientService,
IConfig $config,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->session = $session;
$this->gss = $gss;
Expand All @@ -78,7 +78,7 @@ public function __construct(
public function handleLoginRequest(
string $uid,
?string $password,
?IApacheBackend $backend = null
?IApacheBackend $backend = null,
): void {
$this->logger->debug(
'start handle login request',
Expand Down
1 change: 1 addition & 0 deletions lib/Migration/Version0110Date20180925143400.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
3 changes: 2 additions & 1 deletion lib/Service/SlaveService.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -45,7 +46,7 @@ public function __construct(
IConfig $config,
Lookup $lookup,
GlobalSiteSelector $gss,
ICacheFactory $cacheFactory
ICacheFactory $cacheFactory,
) {
$this->logger = $logger;
$this->clientService = $clientService;
Expand Down
3 changes: 2 additions & 1 deletion lib/Slave.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -41,7 +42,7 @@ public function __construct(
Lookup $lookup,
GlobalSiteSelector $gss,
LoggerInterface $logger,
IConfig $config
IConfig $config,
) {
$this->userManager = $userManager;
$this->clientService = $clientService;
Expand Down
5 changes: 3 additions & 2 deletions lib/TokenHandler.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -21,7 +22,7 @@ class TokenHandler {

public function __construct(
private IProvider $tokenProvider,
private ISecureRandom $random
private ISecureRandom $random,
) {
}

Expand All @@ -34,7 +35,7 @@ public function __construct(
*/
public function generateAppToken($uid) {
// generate random token
$token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
$token = $this->random->generate(72, ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_DIGITS);
$deviceToken = $this->tokenProvider->generateToken($token, $uid, $uid, null, 'Client login', IToken::PERMANENT_TOKEN);
$tokenData = $deviceToken->jsonSerialize();

Expand Down
Loading

0 comments on commit 7cc50fc

Please sign in to comment.