Skip to content

feat (2fa): Add IStatelessProvider interface #57216

Open
Roszakos wants to merge 1 commit intonextcloud:masterfrom
Roszakos:2fa-stateless-provider-interface
Open

feat (2fa): Add IStatelessProvider interface #57216
Roszakos wants to merge 1 commit intonextcloud:masterfrom
Roszakos:2fa-stateless-provider-interface

Conversation

@Roszakos
Copy link
Copy Markdown

@Roszakos Roszakos commented Dec 20, 2025

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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 4, 2026

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.)

@come-nc
Copy link
Copy Markdown
Contributor

come-nc commented Jan 6, 2026

Apart from the license issue, looks good 👍

@Furgas
Copy link
Copy Markdown

Furgas commented Feb 18, 2026

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

@miaulalala
Copy link
Copy Markdown
Contributor

miaulalala commented Mar 2, 2026

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
Copy link
Copy Markdown
Author

Roszakos commented Mar 2, 2026

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.

@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

Signed-off-by: Michał Roszak <m.roszakos@gmail.com>
@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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stateless 2FA providers

7 participants