mirror of https://github.com/nextcloud/server
Compare commits
12 Commits
5531730021
...
22d2f91f1a
Author | SHA1 | Date |
---|---|---|
Jérôme Herbinet | 22d2f91f1a | |
Andy Scherzinger | 4049485ec6 | |
Andy Scherzinger | 2e910e3070 | |
Nextcloud bot | db5adbd7c4 | |
Nextcloud bot | c9047a8a5e | |
Christoph Wurst | acf8ea1761 | |
Christoph Wurst | 21ee7f59bd | |
Robin Appelman | a2fefbce9a | |
Robin Appelman | 40d9a3fcab | |
Anna | 10af08736e | |
Jérôme Herbinet | 2e2c1b4c0d | |
Anna Larch | a28f264783 |
|
@ -2,6 +2,9 @@
|
|||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Dependabot
|
||||
|
||||
|
@ -21,7 +24,7 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
auto-approve-merge:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
if: github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]'
|
||||
runs-on: ubuntu-latest-low
|
||||
permissions:
|
||||
# for hmarr/auto-approve-action to approve PRs
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# This workflow is provided via the organization template repository
|
||||
#
|
||||
# https://github.com/nextcloud/.github
|
||||
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
|
||||
|
||||
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-FileCopyrightText: 2023 Marcel Klehr <mklehr@gmx.net>
|
||||
# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com>
|
||||
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <mail@danielkesselberg.de>
|
||||
# SPDX-FileCopyrightText: 2023 Florian Steffens <florian.steffens@nextcloud.com>
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 'Ask for feedback on PRs'
|
||||
on:
|
||||
schedule:
|
||||
|
@ -5,25 +17,25 @@ on:
|
|||
|
||||
jobs:
|
||||
pr-feedback:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: The get-github-handles-from-website action
|
||||
uses: marcelklehr/get-github-handles-from-website-action@a739600f6b91da4957f51db0792697afbb2f143c # v1.0.0
|
||||
id: scrape
|
||||
with:
|
||||
website: 'https://nextcloud.com/team/'
|
||||
- uses: marcelklehr/pr-feedback-action@601109aa729eb4c8d6d0ece7567b9d4901db4aef
|
||||
- uses: marcelklehr/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4
|
||||
with:
|
||||
feedback-message: |
|
||||
Hello there,
|
||||
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
|
||||
|
||||
We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.
|
||||
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
|
||||
|
||||
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
|
||||
|
||||
Thank you for contributing to Nextcloud and we hope to hear from you soon!
|
||||
days-before-feedback: 14
|
||||
start-date: "2023-07-10"
|
||||
exempt-authors: "${{ steps.scrape.outputs.users }}"
|
||||
exempt-authors: "${{ steps.scrape.outputs.users }},nextcloud-command,nextcloud-android-bot,skjnldsv,datenangebot"
|
||||
exempt-bots: true
|
||||
|
|
|
@ -539,7 +539,7 @@ class IMipService {
|
|||
$data['meeting_title_html'] ?? $data['meeting_title'], $this->l10n->t('Title:'),
|
||||
$this->getAbsoluteImagePath('caldav/title.png'), $data['meeting_title'], '', IMipPlugin::IMIP_INDENT);
|
||||
if ($data['meeting_when'] !== '') {
|
||||
$template->addBodyListItem($data['meeting_when_html'] ?? $data['meeting_when'], $this->l10n->t('Time:'),
|
||||
$template->addBodyListItem($data['meeting_when_html'] ?? $data['meeting_when'], $this->l10n->t('Date and time:'),
|
||||
$this->getAbsoluteImagePath('caldav/time.png'), $data['meeting_when'], '', IMipPlugin::IMIP_INDENT);
|
||||
}
|
||||
if ($data['meeting_location'] !== '') {
|
||||
|
@ -682,7 +682,7 @@ class IMipService {
|
|||
return false;
|
||||
}
|
||||
$type = $cuType->getValue() ?? 'INDIVIDUAL';
|
||||
if (\in_array(strtoupper($type), ['RESOURCE', 'ROOM', 'UNKNOWN'], true)) {
|
||||
if (\in_array(strtoupper($type), ['RESOURCE', 'ROOM'], true)) {
|
||||
// Don't send emails to things
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -71,11 +71,17 @@ trait S3ConnectionTrait {
|
|||
$this->copySizeLimit = $params['copySizeLimit'] ?? 5242880000;
|
||||
$this->useMultipartCopy = (bool)($params['useMultipartCopy'] ?? true);
|
||||
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
|
||||
$params['s3-accelerate'] = $params['hostname'] == 's3-accelerate.amazonaws.com' || $params['hostname'] == 's3-accelerate.dualstack.amazonaws.com';
|
||||
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
|
||||
if (!isset($params['port']) || $params['port'] === '') {
|
||||
$params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443;
|
||||
}
|
||||
$params['verify_bucket_exists'] = $params['verify_bucket_exists'] ?? true;
|
||||
|
||||
if ($params['s3-accelerate']) {
|
||||
$params['verify_bucket_exists'] = false;
|
||||
}
|
||||
|
||||
$this->params = $params;
|
||||
}
|
||||
|
||||
|
@ -122,6 +128,13 @@ trait S3ConnectionTrait {
|
|||
'http' => ['verify' => $this->getCertificateBundlePath()],
|
||||
'use_aws_shared_config_files' => false,
|
||||
];
|
||||
|
||||
if ($this->params['s3-accelerate']) {
|
||||
$options['use_accelerate_endpoint'] = true;
|
||||
} else {
|
||||
$options['endpoint'] = $base_url;
|
||||
}
|
||||
|
||||
if ($this->getProxy()) {
|
||||
$options['http']['proxy'] = $this->getProxy();
|
||||
}
|
||||
|
@ -150,7 +163,9 @@ trait S3ConnectionTrait {
|
|||
'exception' => $e,
|
||||
'app' => 'objectstore',
|
||||
]);
|
||||
throw new \Exception('Creation of bucket "' . $this->bucket . '" failed. ' . $e->getMessage());
|
||||
if ($e->getAwsErrorCode() !== "BucketAlreadyOwnedByYou") {
|
||||
throw new \Exception('Creation of bucket "' . $this->bucket . '" failed. ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -767,8 +767,6 @@ class Session implements IUserSession, Emitter {
|
|||
return false;
|
||||
}
|
||||
|
||||
$dbToken->setLastCheck($now);
|
||||
$this->tokenProvider->updateToken($dbToken);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,9 +11,11 @@ namespace Test\User;
|
|||
use OC\AppFramework\Http\Request;
|
||||
use OC\Authentication\Events\LoginFailed;
|
||||
use OC\Authentication\Exceptions\InvalidTokenException;
|
||||
use OC\Authentication\Exceptions\PasswordlessTokenException;
|
||||
use OC\Authentication\Exceptions\PasswordLoginForbiddenException;
|
||||
use OC\Authentication\Token\IProvider;
|
||||
use OC\Authentication\Token\IToken;
|
||||
use OC\Authentication\Token\PublicKeyToken;
|
||||
use OC\Security\CSRF\CsrfTokenManager;
|
||||
use OC\Session\Memory;
|
||||
use OC\User\LoginException;
|
||||
|
@ -35,6 +37,8 @@ use OCP\Security\ISecureRandom;
|
|||
use OCP\User\Events\PostLoginEvent;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use function array_diff;
|
||||
use function get_class_methods;
|
||||
|
||||
/**
|
||||
* @group DB
|
||||
|
@ -309,6 +313,80 @@ class SessionTest extends \Test\TestCase {
|
|||
$userSession->login('foo', 'bar');
|
||||
}
|
||||
|
||||
public function testPasswordlessLoginNoLastCheckUpdate(): void {
|
||||
$session = $this->getMockBuilder(Memory::class)->setConstructorArgs([''])->getMock();
|
||||
$managerMethods = get_class_methods(Manager::class);
|
||||
// Keep following methods intact in order to ensure hooks are working
|
||||
$mockedManagerMethods = array_diff($managerMethods, ['__construct', 'emit', 'listen']);
|
||||
$manager = $this->getMockBuilder(Manager::class)
|
||||
->setMethods($mockedManagerMethods)
|
||||
->setConstructorArgs([
|
||||
$this->config,
|
||||
$this->createMock(ICacheFactory::class),
|
||||
$this->createMock(IEventDispatcher::class),
|
||||
])
|
||||
->getMock();
|
||||
$userSession = new Session($manager, $session, $this->timeFactory, $this->tokenProvider, $this->config, $this->random, $this->lockdownManager, $this->logger, $this->dispatcher);
|
||||
|
||||
$session->expects($this->never())
|
||||
->method('set');
|
||||
$session->expects($this->once())
|
||||
->method('regenerateId');
|
||||
$token = new PublicKeyToken();
|
||||
$token->setLoginName('foo');
|
||||
$token->setLastCheck(0); // Never
|
||||
$token->setUid('foo');
|
||||
$this->tokenProvider
|
||||
->method('getPassword')
|
||||
->with($token)
|
||||
->willThrowException(new PasswordlessTokenException());
|
||||
$this->tokenProvider
|
||||
->method('getToken')
|
||||
->with('app-password')
|
||||
->willReturn($token);
|
||||
$this->tokenProvider->expects(self::never())
|
||||
->method('updateToken');
|
||||
|
||||
$userSession->login('foo', 'app-password');
|
||||
}
|
||||
|
||||
public function testLoginLastCheckUpdate(): void {
|
||||
$session = $this->getMockBuilder(Memory::class)->setConstructorArgs([''])->getMock();
|
||||
$managerMethods = get_class_methods(Manager::class);
|
||||
// Keep following methods intact in order to ensure hooks are working
|
||||
$mockedManagerMethods = array_diff($managerMethods, ['__construct', 'emit', 'listen']);
|
||||
$manager = $this->getMockBuilder(Manager::class)
|
||||
->setMethods($mockedManagerMethods)
|
||||
->setConstructorArgs([
|
||||
$this->config,
|
||||
$this->createMock(ICacheFactory::class),
|
||||
$this->createMock(IEventDispatcher::class),
|
||||
])
|
||||
->getMock();
|
||||
$userSession = new Session($manager, $session, $this->timeFactory, $this->tokenProvider, $this->config, $this->random, $this->lockdownManager, $this->logger, $this->dispatcher);
|
||||
|
||||
$session->expects($this->never())
|
||||
->method('set');
|
||||
$session->expects($this->once())
|
||||
->method('regenerateId');
|
||||
$token = new PublicKeyToken();
|
||||
$token->setLoginName('foo');
|
||||
$token->setLastCheck(0); // Never
|
||||
$token->setUid('foo');
|
||||
$this->tokenProvider
|
||||
->method('getPassword')
|
||||
->with($token)
|
||||
->willReturn('secret');
|
||||
$this->tokenProvider
|
||||
->method('getToken')
|
||||
->with('app-password')
|
||||
->willReturn($token);
|
||||
$this->tokenProvider->expects(self::once())
|
||||
->method('updateToken');
|
||||
|
||||
$userSession->login('foo', 'app-password');
|
||||
}
|
||||
|
||||
public function testLoginNonExisting() {
|
||||
$session = $this->getMockBuilder(Memory::class)->setConstructorArgs([''])->getMock();
|
||||
$manager = $this->createMock(Manager::class);
|
||||
|
|
Loading…
Reference in New Issue