File tree Expand file tree Collapse file tree 7 files changed +491
-19
lines changed
Expand file tree Collapse file tree 7 files changed +491
-19
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ While theoretically any other authentication provider implementing either one of
2626 <namespace >User_SAML</namespace >
2727 <types >
2828 <authentication />
29- <dav />
3029 </types >
3130 <documentation >
3231 <admin >https://portal.nextcloud.com/article/configuring-single-sign-on-10.html</admin >
@@ -61,9 +60,4 @@ While theoretically any other authentication provider implementing either one of
6160 <admin >OCA\User_SAML\Settings\Admin</admin >
6261 <admin-section >OCA\User_SAML\Settings\Section</admin-section >
6362 </settings >
64- <sabre >
65- <plugins >
66- <plugin >OCA\User_SAML\DavPlugin</plugin >
67- </plugins >
68- </sabre >
6963</info >
Original file line number Diff line number Diff line change 1212use OC \Security \CSRF \CsrfTokenManager ;
1313use OC \User \LoginException ;
1414use OC_User ;
15+ use OCA \DAV \Events \SabrePluginAddEvent ;
1516use OCA \User_SAML \DavPlugin ;
1617use OCA \User_SAML \GroupBackend ;
1718use OCA \User_SAML \GroupManager ;
1819use OCA \User_SAML \Listener \LoadAdditionalScriptsListener ;
20+ use OCA \User_SAML \Listener \SabrePluginEventListener ;
1921use OCA \User_SAML \Middleware \OnlyLoggedInMiddleware ;
2022use OCA \User_SAML \SAMLSettings ;
2123use OCA \User_SAML \UserBackend ;
@@ -50,6 +52,7 @@ public function __construct(array $urlParams = []) {
5052 public function register (IRegistrationContext $ context ): void {
5153 $ context ->registerMiddleware (OnlyLoggedInMiddleware::class);
5254 $ context ->registerEventListener (BeforeTemplateRenderedEvent::class, LoadAdditionalScriptsListener::class);
55+ $ context ->registerEventListener (SabrePluginAddEvent::class, SabrePluginEventListener::class);
5356 $ context ->registerService (DavPlugin::class, function (ContainerInterface $ c ) {
5457 return new DavPlugin (
5558 $ c ->get (ISession::class),
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+ * SPDX-License-Identifier: AGPL-3.0-or-later
8+ */
9+
10+ namespace OCA \User_SAML \Listener ;
11+
12+ use OCA \DAV \Events \SabrePluginAddEvent ;
13+ use OCA \User_SAML \DavPlugin ;
14+ use OCP \EventDispatcher \Event ;
15+ use OCP \EventDispatcher \IEventListener ;
16+ use OCP \Server ;
17+
18+ /** @template-implements IEventListener<SabrePluginAddEvent|Event> */
19+ class SabrePluginEventListener implements IEventListener {
20+ public function handle (Event $ event ): void {
21+ if (!$ event instanceof SabrePluginAddEvent) {
22+ return ;
23+ }
24+ $ event ->getServer ()->addPlugin (Server::get (DavPlugin::class));
25+ }
26+ }
Original file line number Diff line number Diff line change 44 - SPDX-License-Identifier: AGPL-3.0-or-later
55-->
66<files psalm-version =" 5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0" >
7- <file src =" lib/AppInfo/Application.php" >
8- <MissingDependency >
9- <code ><![CDATA[ DavPlugin]]> </code >
10- <code ><![CDATA[ DavPlugin]]> </code >
11- </MissingDependency >
12- </file >
137 <file src =" lib/Controller/SAMLController.php" >
148 <RedundantCondition >
159 <code ><![CDATA[ !$userExists]]> </code >
2923 <code ><![CDATA[ ClientFlowLoginV2Controller]]> </code >
3024 </UndefinedClass >
3125 </file >
32- <file src =" lib/DavPlugin.php" >
33- <UndefinedClass >
34- <code ><![CDATA[ ServerPlugin]]> </code >
35- </UndefinedClass >
36- </file >
3726 <file src =" lib/Db/ConfigurationsMapper.php" >
3827 <MissingTemplateParam >
3928 <code ><![CDATA[ ConfigurationsMapper]]> </code >
Original file line number Diff line number Diff line change @@ -69,6 +69,20 @@ namespace OC\User {
6969 }
7070}
7171
72+ namespace OCA\DAV\Connector\Sabre {
73+ class Auth {
74+ public const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND';
75+ }
76+ }
77+
78+ namespace OCA\DAV\Events {
79+ use OCP\EventDispatcher\Event;
80+ use Sabre\DAV\Server;
81+ class SabrePluginAddEvent extends Event {
82+ public function getServer(): Server;
83+ }
84+ }
85+
7286class OC_User {
7387 public static function useBackend($userBackend): void;
7488 public static function handleApacheAuth(): void;
Original file line number Diff line number Diff line change 11{
22 "require-dev" : {
33 "nextcloud/ocp" : " dev-stable28" ,
4- "vimeo/psalm" : " ^5.26"
4+ "vimeo/psalm" : " ^5.26" ,
5+ "sabre/dav" : " 4.7.0"
56 },
67 "config" : {
78 "platform" : {
You can’t perform that action at this time.
0 commit comments