Commit graph

2071 commits

Author SHA1 Message Date
mposolda
1cbdf4d17e Fix the issue with LDAP connectionUrl containing multiple hosts
Closes #17359
2023-04-16 17:41:22 +02:00
Michal Hajas
b730d861e7
Refactor map storage transaction initialization
* Refactor transaction to be enlisted in MapStorageProvider instead of area provider

* Make KeycloakTransaction methods optional for MapKeycloakTransaction

* Remove MapStorage interface that contained only createTransaction method

* Rename *MapStorage to *CrudOperations

* Adjust File store to new structure

* Rename MapKeycloakTransaction to MapStorage

* Rename getEnlistedTransaction to getMapStorage in AbstractMapProviderFactory

* Rename variables tx and transaction to store

* Add createMapStorageIfAbsent to JpaMapStorageProvider

* Update JavaDoc

Co-authored-by:  Hynek Mlnarik <hmlnarik@redhat.com>
2023-04-12 11:21:14 +02:00
Martin Kanis
37af5fbffe Introduce optimistic locking for HotRod storage
Closes #15402
2023-04-11 09:33:01 +02:00
Stefan Guilhen
ad3b264088 Introduce last modified time validation
- Also fixes commit/rollback logic to prevent deletion of wrong files on rollback

Closes #17491
Closes #17660
2023-04-06 14:50:46 +02:00
mposolda
554818f422 Rename jpa-changelog-22.0.0.xml
closes #19527
2023-04-04 19:21:14 +02:00
mposolda
4d8d6f8cd8 Preserve authentication flow IDs after import
closes #9564
2023-04-03 16:01:52 +02:00
vramik
5aafc99673 Remove em.refresh(realm) call during realm removal in JpaRealmProvider
Closes #19430
2023-04-03 09:27:13 +02:00
Alexander Schwartz
9affc262bd Consistent handling of enums in the database schema
Closes #19404
2023-03-30 12:14:43 +02:00
Michal Hajas
e49dfe534e Fix missing migration when reading TERMS_AND_CONDITIONS required action in legacy store
Closes #17277
2023-03-29 16:43:01 +02:00
Michal Hajas
2a5b5c4a40 Fix stale client session is present in user session
Closes #17570
2023-03-28 08:32:31 +02:00
Michal Hajas
637c47ac0e Fix NoActionHotRodTransactionWrapper using default exists implementation
Closes #19196
2023-03-28 08:29:50 +02:00
Alexander Schwartz
251f6151e8 Rework the Import SPI to be configurable via the Config API
Also rework the export/import CLI for Quarkus, so that runtime options are available.

Closes #17663
2023-03-24 15:28:55 -03:00
Pedro Hos
bd0a23a865 /users/count endpoint with search field has different behavior than /users query endpoint #17620
closes #17620
2023-03-24 13:43:47 +01:00
Michal Hajas
6d2177f2c8
Remove clientRole flag from HotRodRoleEntity (#17655)
Closes #17086
2023-03-21 09:31:54 +01:00
Alexander Schwartz
513bb809f3 Add a map storage global locking implementation for JPA
Closes #14734
2023-03-21 08:21:11 +01:00
Martin Kanis
5e7793b64d Unexpected invalid_grant error on offline session refresh when client session is not in the cache
Closes #9959

Co-authored-by: Martin Kanis <mkanis@redhat.com>
Co-authored-by: Lex Cao <lexcao@foxmail.com>
2023-03-15 12:39:43 +01:00
Michal Hajas
9c2511e205 Store index data in memory instead of persistent store to make it consistent with cached data
Closes #15653
2023-03-13 14:27:41 +01:00
Michal Hajas
837c64de3d Add support for pessimistic locking to HotRod
Closes #13273
2023-03-07 10:44:31 +01:00
Alexander Schwartz
f6f179eaca Rework the export to use CLI options and property mappers
Also, adding the wiring to support Model tests for the export.

Closes #13613
2023-03-07 08:22:12 +01:00
Michal Hajas
465019bec4 Extract attachDevice outside of storage layer
Closes #17336
2023-03-03 17:58:34 +01:00
Jon Koops
972ebb9650
Use a valid SemVer format for the SNAPSHOT version (#17334)
* Use a valid SemVer format for the SNAPSHOT version

* Update pom.xml

* Update pom.xml

---------

Co-authored-by: Stian Thorgersen <stianst@gmail.com>
Co-authored-by: Stian Thorgersen <stian@redhat.com>
2023-03-03 11:11:44 +01:00
vramik
d923aa5d5d Entity version is not updated when the entity is root entity
Closes #17339
2023-03-02 15:21:43 +01:00
Thomas Darimont
16efddc908
Fix NPE in MigrateTo21_0_0 when admin theme is not set explicitly (#17249)
Only update admin-console theme to keycloak.v2 if it is explicitly set to "keycloak" or "rh-sso".

Fixes #17248

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Co-authored-by: Stian Thorgersen <stian@redhat.com>
2023-02-23 15:37:59 +00:00
Hynek Mlnarik
7d136c5cca Generate map-like collection accessors
Along the way fixes also problem with field delegates which
applied manually-crafted methods like `MapUserEntity.removeCredential(id)`
to the delegate itself rather than to the underlying object.

Co-authored-By: Michal Hajas <mhajas@redhat.com>

Closes: #17223
2023-02-22 17:26:31 +01:00
Hynek Mlnarik
878debd2ab Forbid changing ID
Closes: #16881
2023-02-22 17:19:22 +01:00
Michal Hajas
1c79a5666d Deprecate RoleModel.SearchableFields.IS_CLIENT_ROLE field
Closes #17144
2023-02-16 20:50:46 +01:00
rmartinc
9995a3cdd4 lastSync value into COMPONENT_CONFIG is always updated
Closes https://github.com/keycloak/keycloak/issues/17022
2023-02-16 17:48:49 +01:00
Alexander Schwartz
febe134d5b Make the event listeners specific to the persistence unit
Closes #13219
2023-02-16 11:08:15 +01:00
Hynek Mlnarik
d768e75be7 Fix clientRole warning
Fixes: #16857
2023-02-15 10:59:52 +01:00
Michal Hajas
1f929c78af Make lockTimeout more friendly for JPA map storage
Closes #16616
2023-02-15 10:38:18 +01:00
Hynek Mlnarik
bb0eb899a7 Add ability to run arq testsuite with file store
Fixes: #17032
2023-02-15 10:17:23 +01:00
Hynek Mlnarik
2665fb01a6 File storage: Fix path traversal
Fixes: #17029
2023-02-14 14:30:14 +01:00
Michal Hajas
6fa62e47db Leverage HotRod client provided transaction
Closes #13280
2023-02-08 10:26:30 +01:00
Stian Thorgersen
d3ba2ecbed
Remove old admin console theme (#16864)
Closes #16862
2023-02-08 09:22:39 +01:00
Hynek Mlnařík
f71ab092de
File store basis
Fixes: #16676

---

* Enhance DefaultModelCriteria
* Fix collection
* Fix delete in CHMKeycloakTransaction
* Add HasRealmId interface
* Fix EntityFieldDelegate
* Support for realm-less entities in providers
* Support for realm-less entities in providers (events)
* File store basis
* Add support for writing
* Support running KeycloakServer with file store
* Add support for file store in model testsuite

---------

Co-authored-by: vramik <vramik@redhat.com>
2023-02-07 14:59:23 +01:00
Martin Kanis
5ba004b447 Leverage Infinispan lifespan for ExpirableEntities in HotRod storage 2023-02-07 10:01:32 +01:00
Alexander Schwartz
48aae83891 Close prepared statement used to set the lock timeout
Closes #16801
2023-02-06 17:30:58 +01:00
Martin Kanis
a912558d29 Add MapKeycloakTransaction.exists methods 2023-01-31 17:21:40 +01:00
Klaus Betz
20a7a5acdb fix: consider identity provider models from third-party packages 2023-01-31 06:05:02 -08:00
Alexander Schwartz
c6aba2e3de Make LockAcquiringTimeoutException a RuntimeException
Closes #16690
2023-01-31 08:21:32 +01:00
Alexander Schwartz
7933f0489d Align startup of Quarkus with the regular startup to ensure boostrap locks are created.
Also fixing an issue where DBLockGlobalLockProviderFactory held on to an old session, which lead to a closed DB connection on Quarkus.

Closes #16642
2023-01-30 12:59:40 +01:00
Michal Hajas
eb59fdb772 Add transaction tests to model tests
Closes: #15890
2023-01-26 12:55:22 +01:00
Alexander Schwartz
e9e6b73bd2 Avoid using Hibernate APIs to cache query results as the API changes in Hibernate 6
Closes #16332
2023-01-18 14:42:42 +01:00
Hynek Mlnarik
3119566407 Prevent endless loop in case of split-brain
Fixes: #16427
2023-01-13 16:23:18 +01:00
vramik
f11bef3e7f EntityField mapPut and collectionAdd default methods doesn't insert an element when get(e) returns null
Closes #16317
2023-01-09 15:52:58 +01:00
Pedro Igor
522bf1c0b0 Keep consistency when importing realms at startup when they are exported via the export command
Closes #16281

Co-authored-by: Martin Bartoš <mabartos@redhat.com>
2023-01-06 18:53:01 +01:00
Hynek Mlnarik
7708e2cc5c Fix putAll issues
Closes: #16287
2023-01-06 12:01:19 +01:00
Michal Hajas
6566b58be1 Introduce Infinispan GlobalLock implementation
Closes #14721
2023-01-05 16:58:44 +01:00
Hynek Mlnarik
071fc03f41 Move transaction processing into session close
Fixes: #15223
2023-01-05 16:12:32 +01:00
vramik
f7ad00270e Unique constraints should use attribute value hash instead of the value itself
Closes #15699
Closes #15507
2023-01-05 13:38:06 +01:00