Skip to content

feat (2fa): Add IStatelessProvider interface #57216

Merged
artonge merged 2 commits into
nextcloud:masterfrom
Roszakos:2fa-stateless-provider-interface
Jun 11, 2026
Merged

feat (2fa): Add IStatelessProvider interface #57216
artonge merged 2 commits into
nextcloud:masterfrom
Roszakos:2fa-stateless-provider-interface

Conversation

@Roszakos

@Roszakos Roszakos commented Dec 20, 2025

Copy link
Copy Markdown

Summary

Adds an IStatelessProvider interface. Per-user 2FA activation state for providers implementing this interface will not be stored in the database, thus isTwoFactorAuthEnabledForUser method will be called on every login attempt.

Checklist

@Roszakos Roszakos requested review from ArtificialOwl, come-nc, icewind1991 and provokateurin and removed request for a team December 20, 2025 13:22
Comment thread lib/public/Authentication/TwoFactorAuth/IStatelessProvider.php Outdated
Comment thread lib/public/Authentication/TwoFactorAuth/IStatelessProvider.php
@github-actions

github-actions Bot commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

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 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!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Comment thread lib/public/Authentication/TwoFactorAuth/IStatelessProvider.php Outdated
Comment thread lib/public/Authentication/TwoFactorAuth/IStatelessProvider.php Outdated
@come-nc

come-nc commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Apart from the license issue, looks good 👍

@Furgas

Furgas commented Feb 18, 2026

Copy link
Copy Markdown

Is there anything left to do in this pull request? In what version are you plannig to include this change?

Comment thread lib/public/Authentication/TwoFactorAuth/IStatelessProvider.php Outdated
@miaulalala

miaulalala commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Looks like you need to update your autoloaders:

The autoloaders are not up to date
Please run: bash build/autoloaderchecker.sh
And commit the result

@Roszakos

Roszakos commented Mar 2, 2026

Copy link
Copy Markdown
Author

It's done. Let me know if there is anything else that could prevent this change from getting pulled.

@miaulalala

Copy link
Copy Markdown
Contributor

It's done. Let me know if there is anything else that could prevent this change from getting pulled.

Thanks for doing that! Let me start the workflows and see where we're at.

Comment thread lib/composer/composer/LICENSE Outdated
@miaulalala miaulalala requested review from CarlSchwan and come-nc March 2, 2026 16:34
@miaulalala

Copy link
Copy Markdown
Contributor

Looking good! Last commit is missing the signoff, you can add it with

git commit --amend --signoff and then
git push --force-with-lease

@miaulalala miaulalala self-requested a review March 3, 2026 11:15
@Roszakos Roszakos force-pushed the 2fa-stateless-provider-interface branch from 53c5987 to 4fe1332 Compare March 3, 2026 18:44
@miaulalala

Copy link
Copy Markdown
Contributor

hey @Roszakos - please fix the unit tests:

 
Time: 01:36.992, Memory: 321.00 MB

There were 3 failures:

1) OCA\DAV\Tests\unit\CapabilitiesTest::testGetCapabilities
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     'dav' => Array &1 [
         'chunking' => '1.0',
         'public_shares_chunking' => true,
+        'search_supports_creation_time' => true,
+        'search_supports_upload_time' => true,
     ],
 ]

/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CapabilitiesTest.php:36

2) OCA\DAV\Tests\unit\CapabilitiesTest::testGetCapabilitiesWithBulkUpload
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     'dav' => Array &1 [
         'chunking' => '1.0',
         'public_shares_chunking' => true,
+        'search_supports_creation_time' => true,
+        'search_supports_upload_time' => true,
         'bulkupload' => '1.0',
     ],
 ]

/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CapabilitiesTest.php:57

3) OCA\DAV\Tests\unit\CapabilitiesTest::testGetCapabilitiesWithAbsence
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     'dav' => Array &1 [
         'chunking' => '1.0',
         'public_shares_chunking' => true,
+        'search_supports_creation_time' => true,
+        'search_supports_upload_time' => true,
         'absence-supported' => true,
         'absence-replacement' => true,
     ],
 ]

/home/runner/actions-runner/_work/server/server/apps/dav/tests/unit/CapabilitiesTest.php:79

If you need any help, join us in the community dev chat

@Roszakos Roszakos force-pushed the 2fa-stateless-provider-interface branch 2 times, most recently from 7c96745 to 72ba2c9 Compare March 23, 2026 17:47
@miaulalala

Copy link
Copy Markdown
Contributor

Can you squash your commits into one?

First, sync your fork.

Then run git reset --soft origin/master

Commit all files git commit -sm "feat (2fa): Add IStatelessProvider interface"

And then push git push --force-with-lease

@Roszakos Roszakos force-pushed the 2fa-stateless-provider-interface branch from 51d66a8 to 7c56172 Compare March 26, 2026 16:25
@Roszakos

Copy link
Copy Markdown
Author

It's done

@Furgas

Furgas commented Apr 28, 2026

Copy link
Copy Markdown

Are you planning to include this PR in v34?

@miaulalala miaulalala force-pushed the 2fa-stateless-provider-interface branch 2 times, most recently from e8d75f1 to e41a224 Compare May 4, 2026 11:07
@miaulalala

Copy link
Copy Markdown
Contributor

@Roszakos can you fix the CI issues please?

Psalm:

Error: lib/private/Talk/Broker.php:99:2: MissingOverrideAttribute: Method OC\Talk\Broker::isallowedtocreateconversations should have the "Override" attribute (see https://psalm.dev/358)
Error: lib/private/Talk/Broker.php:107:2: MissingOverrideAttribute: Method OC\Talk\Broker::isenabledforuser should have the "Override" attribute (see https://psalm.dev/358)

@provokateurin

Copy link
Copy Markdown
Member

@miaulalala psalm was unrelated to the changes.

@provokateurin provokateurin enabled auto-merge May 5, 2026 08:15
auto-merge was automatically disabled May 5, 2026 08:41

Head branch was pushed to by a user without write access

@Roszakos Roszakos force-pushed the 2fa-stateless-provider-interface branch from 058c15f to b902719 Compare May 5, 2026 08:41
@Roszakos

Roszakos commented May 5, 2026

Copy link
Copy Markdown
Author

I squashed the last merge commit.
@provokateurin Could you please enable auto-merge again?

@provokateurin provokateurin enabled auto-merge May 5, 2026 08:50
@Roszakos

Roszakos commented May 6, 2026

Copy link
Copy Markdown
Author

Some checks are still failing so i guess the auto-merge won't run (correct me if i'm wrong) - is there anything I should do about it?

@provokateurin

Copy link
Copy Markdown
Member

I just restarted them. The failures are likely not related.

Signed-off-by: michal.roszak@put.poznan.pl <michal.roszak@put.poznan.pl>
@miaulalala miaulalala force-pushed the 2fa-stateless-provider-interface branch from b902719 to c42bc0c Compare May 6, 2026 21:03
@susnux susnux added the community pull requests from community label Jun 9, 2026
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@artonge artonge disabled auto-merge June 11, 2026 09:01
@artonge artonge merged commit 996fcfe into nextcloud:master Jun 11, 2026
45 of 46 checks passed
@welcome

welcome Bot commented Jun 11, 2026

Copy link
Copy Markdown

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stateless 2FA providers