Skip to content
Merged

8.1.2 #1132

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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# Changelog
All notable changes to this project will be documented in this file.

## 8.1.2

### Fixed

* fix: Using user_saml at the same time as the guest application

## 8.1.1

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following providers are supported and tested at the moment:
* Any other provider that authenticates using the environment variable

While theoretically any other authentication provider implementing either one of those standards is compatible, we like to note that they are not part of any internal test matrix.]]></description>
<version>8.1.1</version>
<version>8.1.2</version>
<licence>AGPL-3.0-or-later</licence>
<author>Lukas Reschke</author>
<namespace>User_SAML</namespace>
Expand Down
4 changes: 0 additions & 4 deletions lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Services\IAppConfig;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
Expand All @@ -39,7 +38,6 @@
use OCP\Security\ICrypto;
use OCP\Security\ITrustedDomainHelper;
use OCP\Server;
use OCP\User\Events\UserLoggedInEvent;
use OneLogin\Saml2\Auth;
use OneLogin\Saml2\Error;
use OneLogin\Saml2\Settings;
Expand Down Expand Up @@ -68,7 +66,6 @@ public function __construct(
private ICrypto $crypto,
private ITrustedDomainHelper $trustedDomainHelper,
private SessionService $sessionService,
private IEventDispatcher $eventDispatcher,
) {
parent::__construct($appName, $request);
}
Expand Down Expand Up @@ -394,7 +391,6 @@ public function assertionConsumerService(): Http\RedirectResponse {
if ($firstLogin) {
$this->userBackend->initializeHomeDir($user->getUID());
}
$this->eventDispatcher->dispatchTyped(new UserLoggedInEvent($user, $user->getUID(), null, true));
} catch (NoUserFoundException $e) {
throw new \InvalidArgumentException('User "' . $this->userBackend->getCurrentUserId() . '" is not valid.', previous: $e);
} catch (Exception $e) {
Expand Down
11 changes: 3 additions & 8 deletions tests/unit/Controller/SAMLControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IAppConfig;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IL10N;
use OCP\IRequest;
Expand Down Expand Up @@ -50,9 +49,8 @@ class SAMLControllerTest extends TestCase {
private IL10N&MockObject $l;
private ICrypto&MockObject $crypto;
private SAMLController $samlController;
private ITrustedDomainHelper&MockObject $trustedDomainController;
private SessionService&MockObject $sessionService;
private IEventDispatcher&MockObject $eventDispatcher;
private ITrustedDomainHelper|MockObject $trustedDomainController;
private SessionService|MockObject $sessionService;

#[Override]
protected function setUp(): void {
Expand All @@ -73,7 +71,6 @@ protected function setUp(): void {
$this->crypto = $this->createMock(ICrypto::class);
$this->trustedDomainController = $this->createMock(ITrustedDomainHelper::class);
$this->sessionService = $this->createMock(SessionService::class);
$this->eventDispatcher = $this->createMock(IEventDispatcher::class);

$this->l->expects($this->any())->method('t')->willReturnCallback(
static fn (string $param): string => $param
Expand All @@ -98,8 +95,7 @@ protected function setUp(): void {
$this->userData,
$this->crypto,
$this->trustedDomainController,
$this->sessionService,
$this->eventDispatcher,
$this->sessionService
);
}

Expand Down Expand Up @@ -267,7 +263,6 @@ public function testLoginWithEnvVariable(array $samlUserData, string $redirect,

if (isset($samlUserData['uid']) && !($userState === 0 && $autoProvision === 0)) {
$user = $this->createMock(IUser::class);
$user->method('getUID')->willReturn('MyUid');
$im = $this->userResolver
->expects($this->once())
->method('findExistingUser')
Expand Down
Loading