Commit Graph

332 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
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 +07: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 +07:00
Julien Veyssier 4a35837741
feat(auth): adjust PublicKeyTokenProviderTest
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2025-08-21 12:42:44 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
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 +07:00
yemkareems 79b1122749
fix: use Icrypto in place of Cypto
Signed-off-by: yemkareems <yemkareems@gmail.com>
2024-10-28 15:49:05 +07:00
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 +07:00
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 +07:00
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 +07: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 +07:00
Ferdinand Thiessen 0e54c2bd43
fix: Adjust Entity types
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-10-17 18:31:44 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Arthur Schiwon f6d6efef3a
refactor(Token): introduce scope constants
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-06-05 19:01:14 +07: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 +07:00
Daniel fca38e12c8
Merge pull request #45411 from nextcloud/fix/auth/selective-token-activity-update
fix(auth): Update authtoken activity selectively
2024-05-29 12:05:45 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Christoph Wurst bcc02a3c71
fix(auth): Update authtoken activity selectively
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-05-21 07:55:01 +07:00
Christoph Wurst fe7217d2d3
Merge pull request #45026 from nextcloud/fix/token-update
Avoid updating the same oc_authtoken row twice
2024-05-16 12:00:32 +07:00
Julius Härtl 04780ae30a fix: Always set last activity if we update the row of an authtoken anyways
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2024-04-29 15:20:17 +07:00
Joas Schilling bc4a102f52
fix(session): Avoid race condition for cache::get() vs. cache::hasKey()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-29 12:45:44 +07:00
Ferdinand Thiessen e8452d9ef1
fix(deps): Bump web-auth/webauthn-lib from 3.3.9 to 4.8.5
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-04-16 11:48:13 +07:00
Côme Chilliet ab6afe0111 fix: Fix new psalm errors from update
Not sure about the SimpleContainer modification, let’s see what CI says
 about that.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-08 11:29:09 +07:00
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Benjamin Gaussorgues d1189f923c
feat(perf): add cache for authtoken lookup
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2024-02-28 15:04:04 +07:00
Vincent Petry 839ddaa354
feat: rename users to account or person
Replace translated text in most locations

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2024-02-13 21:06:30 +07:00
Côme Chilliet 8bcc2d352e chore: Fix missing template parameter for IEventListener
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-30 10:57:15 +07:00
Côme Chilliet a526a382bf
Import OCP IToken as OCPIToken to avoid a name clash in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-11 15:45:14 +07:00
Côme Chilliet 37a6e15f87 Use OCP version of IToken in AppPasswordCreatedEvent
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-11 14:02:15 +07:00