Commit graph

346 commits

Author SHA1 Message Date
provokateurin
83fbc64c99
fix(IResult): Use more accurate conditional return type for fetchAll
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-11 08:50:13 +01:00
provokateurin
f12cecb684
feat(rector): Enable SafeDeclareStrictTypesRector
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00
Carl Schwan
3979c493f9
refactor: Apply second batch of comments
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:52:51 +01:00
Carl Schwan
65e769a861
refactor: Apply comments
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:46 +01:00
Carl Schwan
7b6078875b
refactor: Run rector on lib/private
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:18 +01:00
Côme Chilliet
1f5e6cbbb4
feat: Add SetupCheck to warn about missing second factor provider
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-02-02 11:55:16 +01:00
Joas Schilling
6c20e3e103 fix(onetime): Allow longer duration via app config
Signed-off-by: Joas Schilling <coding@schilljs.com>
2026-01-09 19:07:07 +01:00
Joas Schilling
6b121c37da feat: Allow to create one-time app passwords that only allow loading an app-password
Signed-off-by: Joas Schilling <coding@schilljs.com>
2026-01-09 19:07:07 +01:00
Carl Schwan
693a2263cc
fix(entity): Do not call getId when inserting and $id is null
Otherwise this breaks some existing code, in particular PublicKeyToken

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-06 15:42:03 +01:00
Carl Schwan
7c1a8a4060
feat: Adapt a bit the snowflake ids API
- Rename setId() -> generateId() in SnowflakeAwareEntity

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-06 12:57:17 +01:00
Anna Larch
5f797ebc32
refactor: move existing usages of snoflake IDs SnowflakeAwareEntity
Signed-off-by: Anna Larch <anna@nextcloud.com>
2026-01-06 12:57:17 +01:00
Côme Chilliet
4e83d20837 feat(login): Add rememberme checkbox
Only present if allowed by configuration.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-13 13:25:59 +00:00
Côme Chilliet
28b48eec39 chore: Improve typing and codestyle in LoginData
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-11-13 13:25:59 +00:00
Louis Chmn
ed4a1708f2 feat(EphemeralSessions): Introduce lax period
Signed-off-by: Louis Chmn <louis@chmn.me>
2025-11-05 16:08:13 +01:00
Carl Schwan
c4e6fbdae7 fix(query-builder): Don't catch UniqueConstraintViolationException
UniqueConstraintViolationException is no longer throw directly but
instead is now wrapped inside a \OCP\DB\Exception. So check the
exception reason.

Signed-off-by: Carl Schwan <carl.schwan@nextclound.com>
2025-09-02 11:55:58 +02:00
Julien Veyssier
3d36834284
feat(auth): include the token entity in TokenInvalidatedEvent
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-21 12:42:44 +02:00
Julien Veyssier
4a35837741
feat(auth): adjust PublicKeyTokenProviderTest
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-21 12:42:44 +02:00
Julien Veyssier
3da919c783
feat(auth): dispatch new TokenInvalidatedEvent when PublicKeyTokenProvider::invalidateToken is called
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-21 12:42:44 +02:00
Julien Veyssier
8ffd30bbf9
feat(auth): dispatch new TokenInvalidatedEvent when PublicKeyTokenProvider::invalidateTokenById is called
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-21 12:42:43 +02:00
Ferdinand Thiessen
ac545cc478
fix(SetUserTimezoneCommand): only write user login timezone if not yet set
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-18 12:40:42 +02:00
Ferdinand Thiessen
5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Ferdinand Thiessen
a243e9cfbb
fix(webauthn): do not require bcmath or gmp - not needed anymore
The extensions are not required anymore but only recommended for
performance. See also:
https://github.com/web-auth/webauthn-framework/issues/213

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-19 11:19:49 +01:00
Julius Knorr
bb6b462690
Merge pull request #51130 from nextcloud/fix/credential-passwordless-auth
fix: Do not build encrypted password if there is none
2025-03-07 16:49:18 +01:00
Julius Knorr
777cd941dc
fix: Do not build encrypted password if there is none
Signed-off-by: Julius Knorr <jus@bitgrid.net>
2025-03-06 09:31:29 +01:00
Ferdinand Thiessen
3c4feff028
fix: Move login via email logic to local backend
Backends can decide which names they accept for login,
e.g. with user_ldap you can configure arbitrary login fields.
This was a hacky approach to allow login via email,
so instead this is now only handled by the local user backend.

This also fixes some other related problems:
Other logic relys on `backend::get()` which was not handling email,
so e.g. password policy could not block users logged in via email
if they use out-dated passwords.
Similar for other integrations, as the user backend was not consistent with
what is a login name and what not.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-03 18:02:07 +01:00
Louis Chemineau
68f86b3066
fix(login): Support subfolder install for ephemeral sessions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-27 16:22:45 +01:00
Louis Chemineau
c6293204a2
feat: Close sessions created for login flow v2
Sessions created during the login flow v2 should be short lived to not leave an unexpected opened session in the browser.

This commit add a property to the session object to track its origin, and will close it as soon as possible, i.e., on the first non public page request.

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-26 13:42:18 +01:00
Daniel Calviño Sánchez
5ea5b2de84
fix: Handle exception when clearing previously removed two factor tokens
If a token was already removed from the database but not from the
configuration clearing the tokens will try to remove it again from the
database, which caused a DoesNotExistException to be thrown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-11-05 11:14:05 +01:00
Daniel Calviño Sánchez
381a2aa627
fix: Clear pending two factor tokens also from configuration
Otherwise as the tokens were removed from the database but not from the
configuration the next time that the tokens were cleared the previous
tokens were still got from the configuration, and trying to remove them
again from the database ended in a DoesNotExistException being thrown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-11-05 11:14:04 +01:00
yemkareems
34b07ace95
fix: crypto made inline for constructor and decrypt error handled in exception
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 16:43:24 +05:30
yemkareems
3fd16de636
fix: crypto made inline for constructor and decrypt error handled in exception
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 16:32:57 +05:30
yemkareems
79b1122749
fix: use Icrypto in place of Cypto
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 15:49:05 +05:30
yemkareems
a74ef8237d
fix: crypto type made not nullable and tests run using ICrypto
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 15:04:11 +05:30
yemkareems
505dfd65fd
fix: encrypt and store password, decrypt and retrieve the same
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 11:22:36 +05:30
Ferdinand Thiessen
2ef74b9860
Merge pull request #47329 from nextcloud/feat/add-datetime-qbmapper-support
feat(AppFramework): Add full support for date / time / datetime columns
2024-10-18 19:05:08 +02:00
Git'Fellow
a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +02:00
Ferdinand Thiessen
0e54c2bd43
fix: Adjust Entity types
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:44 +02:00
Git'Fellow
c254855222 chore(db): Correctly apply query types
fix: psalm

fix: error

fix: add batch

fix: fatal error

fix: add batch

chore: add batch

chore: add batch

fix: psalm

fix: typo

fix: psalm

fix: return bool

fix: revert Manager
2024-10-17 09:21:07 +02:00
Ferdinand Thiessen
16833aff86
fix: Make user removal more resilient
Currently there is a problem if an exception is thrown in `User::delete`,
because at that point the user is already removed from the backend,
but not all data is deleted.

There is no way to recover from this state, as the user is gone no information is available anymore.
This means the data is still available on the server but can not removed by any API anymore.

The solution here is to first set a flag and backup the user home,
this can be used to recover failed user deletions in a way the delete can be re-tried.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-26 20:48:37 +02:00
Ferdinand Thiessen
a8f46af20f
chore: Add proper deprecation dates where missing
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-20 00:46:03 +02:00
provokateurin
9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Côme Chilliet
7ed583cb8e
chore: Migrate cleanAppId and getAppPath calls to IAppManager from OC_App
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-09-13 10:08:43 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
S1m
9189bc290b
feat(webauthn): Add user verification to webauthn challenges
Require user verification if all tokens are registered
with UV flag, else discourage it

Signed-off-by: S1m <git@sgougeon.fr>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-08-15 11:03:10 +02:00
Christoph Wurst
5100e3152d
feat(auth): Clean-up unused auth tokens and wipe tokens
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-08-13 12:39:11 +02:00
Arthur Schiwon
99182aac37
fix(Token): take over scope in token refresh with login by cookie
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-07-19 15:53:46 +02:00
Arthur Schiwon
6a783d9b08
fix(Session): avoid race conditions on clustered setups
- re-stablishes old behaviour with cache to return null instead of throwing
  an InvalidTokenException when the token is cached as non-existing
- token invalidation and re-generation are bundled in a DB transaction now

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-07-10 13:28:33 +02:00
Joas Schilling
8130968a35
feat(notifications): Migrate server INotifiers to new exceptions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-06-25 11:56:24 +02:00
Arthur Schiwon
f6d6efef3a
refactor(Token): introduce scope constants
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-06-05 19:01:14 +02:00
Arthur Schiwon
340939e688
fix(Session): avoid password confirmation on SSO
SSO backends like SAML and OIDC tried a trick to suppress password
confirmations as they are not possible by design. At least for SAML it was
not reliable when existing user backends where used as user repositories.

Now we are setting a special scope with the token, and also make sure that
the scope is taken over when tokens are regenerated.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-06-05 19:01:13 +02:00