Skip to content

Commit 1e2203b

Browse files
authored
Merge pull request #91 from fschmtt/keycloak-24
Add support for Keycloak 24
2 parents 2d7b6c5 + 5dd69d6 commit 1e2203b

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

.github/workflows/php-integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 22.0.5, 23.0.0]
15+
keycloak: [17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 22.0.5, 23.0.0, 24.0.0]
1616

1717
env:
1818
KEYCLOAK_VERSION: ${{ matrix.keycloak }}

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![PHP Legacy (Keycloak compatibility)](https://github.com/fschmtt/keycloak-rest-api-client-php/actions/workflows/php-integration-legacy.yml/badge.svg?branch=main)
66

77
# Keycloak Admin REST API Client
8-
PHP client to interact with [Keycloak's Admin REST API](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html).
8+
PHP client to interact with [Keycloak's Admin REST API](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html).
99

1010
Inspired by [keycloak/keycloak-nodejs-admin-client](https://github.com/keycloak/keycloak-nodejs-admin-client).
1111

@@ -43,7 +43,7 @@ echo sprintf(
4343
```
4444
will print e.g.
4545
```text
46-
Keycloak 23.0.0 is running on Linux/5.10.25-linuxkit (amd64) with OpenJDK 64-Bit Server VM/11.0.11 since 0 days, 2 hours, 37 minutes, 7 seconds and is currently using 139 MB of 512 MB (28 %) memory.
46+
Keycloak 24.0.0 is running on Linux/5.10.25-linuxkit (amd64) with OpenJDK 64-Bit Server VM/11.0.11 since 0 days, 2 hours, 37 minutes, 7 seconds and is currently using 139 MB of 512 MB (28 %) memory.
4747
```
4848

4949
More examples can be found in the [examples](examples) directory.
@@ -94,22 +94,22 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
9494
```
9595

9696
## Available Resources
97-
### [Attack Detection](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_attack_detection_resource)
97+
### [Attack Detection](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_attack_detection_resource)
9898
| Endpoint | Response | API |
9999
|----------|----------|-----|
100100
| `DELETE /admin/realms/{realm}/attack-detection/brute-force/users` | `n/a` | [AttackDetection::clear()](src/Resource/AttackDetection.php) |
101101
| `GET /admin/realms/{realm}/attack-detection/brute-force/users/{userId}` | [Map](src/Type/Map.php) | [AttackDetection::userStatus()](src/Resource/AttackDetection.php) |
102102
| `DELETE /admin/realms/{realm}/attack-detection/brute-force/users/{userId}` | `n/a` | [AttackDetection::clearUser()](src/Resource/AttackDetection.php) |
103103

104-
### [Clients](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_clients_resource)
104+
### [Clients](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_clients_resource)
105105
| Endpoint | Response | API |
106106
|----------|----------|-----|
107107
| `GET /admin/realms/{realm}/clients` | [ClientCollection](src/Collection/ClientCollection.php) | [Clients::all()](src/Resource/Clients.php) |
108108
| `GET /admin/realms/{realm}/clients/{id}` | [Client](src/Representation/Client.php) | [Clients::get()](src/Resource/Clients.php) |
109109
| `PUT /admin/realms/{realm}/clients/{id}` | [Client](src/Representation/Client.php) | [Clients::update()](src/Resource/Clients.php) |
110110
| `POST /admin/realms/{realm}/clients` | [Client](src/Representation/Client.php) | [Clients::import()](src/Resource/Clients.php) |
111111

112-
### [Groups](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_clients_resource)
112+
### [Groups](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_clients_resource)
113113
| Endpoint | Response | API |
114114
|---------------------------------------------------|----------|-----------------------------------------------|
115115
| `GET /admin/realms/{realm}/groups` | [GroupCollection](src/Collection/GroupCollection.php) | [Groups::all()](src/Resource/Groups.php) |
@@ -120,7 +120,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
120120
| `POST /admin/realms/{realm}/groups/{id}/children` | `n/a` | [Groups::create()](src/Resource/Groups.php) |
121121
| `DELETE /admin/realms/{realm}/groups` | `n/a` | [Groups::delete()](src/Resource/Groups.php) |
122122

123-
### [Realms Admin](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_realms_admin_resource)
123+
### [Realms Admin](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_realms_admin_resource)
124124
| Endpoint | Response | API |
125125
|----------|----------|-----|
126126
| `POST /admin/realms` | [Realm](src/Representation/Realm.php) | [Realms::import()](src/Resource/Realms.php) |
@@ -134,7 +134,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
134134
| `POST /admin/realms/{realm}/clear-realm-cache` | `n/a` | [Realms::clearRealmCache()](src/Resource/Realms.php) |
135135
| `POST /admin/realms/{realm}/clear-user-cache` | `n/a` | [Realms::clearUserCache()](src/Resource/Realms.php) |
136136

137-
### [Users](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_users_resource)
137+
### [Users](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_users_resource)
138138
| Endpoint | Response | API |
139139
|----------|----------|-----|
140140
| `GET /admin/realms/{realm}/users` | [UserCollection](src/Collection/UserCollection.php) | [Users::all()](src/Resource/Users.php) |
@@ -152,15 +152,15 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
152152
| `DELETE /{realm}/users/{id}/role-mappings/realm` | `n/a` | [Users::removeRealmRoles()](src/Resource/Users.php) |
153153
| `PUT /{realm}/users/{id}/execute-actions-email` | `n/a` | [Users::executeActionsEmail()](src/Resource/Users.php) |
154154

155-
### [Roles](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_roles_resource)
155+
### [Roles](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_roles_resource)
156156
| Endpoint | Response | API |
157157
|----------|----------|-----|
158158
| `GET /admin/realms/{realm}/roles` | [RoleCollection](src/Collection/RoleCollection.php) | [Roles::all()](src/Resource/Roles.php) |
159159
| `GET /admin/realms/{realm}/roles/{roleName}` | [Role](src/Representation/Role.php) | [Roles::get()](src/Resource/Roles.php) |
160160
| `POST /admin/realms/{realm}/roles` | `n/a` | [Roles::create()](src/Resource/Roles.php) |
161161
| `DELETE /admin/realms/{realm}/roles/{roleName}` | `n/a` | [Roles::delete()](src/Resource/Roles.php) |
162162

163-
### [Root](https://www.keycloak.org/docs-api/23.0.0/rest-api/index.html#_root_resource)
163+
### [Root](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_root_resource)
164164
| Endpoint | Response | API |
165165
|----------|----------|-----|
166166
| `GET /admin/serverinfo` | [ServerInfo](src/Representation/ServerInfo.php) | [ServerInfo::get()](src/Resource/ServerInfo.php) |

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
working_dir: /app
1111

1212
keycloak:
13-
image: quay.io/keycloak/keycloak:23.0.0
13+
image: quay.io/keycloak/keycloak:24.0.0
1414
command: start-dev
1515
environment:
1616
KEYCLOAK_ADMIN: admin

docker/keycloak/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG KEYCLOAK_VERSION=23.0.0
1+
ARG KEYCLOAK_VERSION=24.0.0
22
FROM quay.io/keycloak/keycloak:${KEYCLOAK_VERSION}
33

44
ENTRYPOINT [ "/opt/keycloak/bin/kc.sh", "start-dev" ]

src/Representation/Realm.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
* @method int|null getEventsExpiration()
6969
* @method array|null getEventsListeners()
7070
* @method int|null getFailureFactor()
71-
* @method array|null getFederatedUsers()
71+
* @method UserCollection|null getFederatedUsers()
72+
* @method string|null getFirstBrokerLoginFlow()
7273
* @method GroupCollection|null getGroups()
7374
* @method string|null getId()
7475
* @method array|null getIdentityProviderMappers()
@@ -79,6 +80,7 @@
7980
* @method bool|null getLoginWithEmailAllowed()
8081
* @method int|null getMaxDeltaTimeSeconds()
8182
* @method int|null getMaxFailureWaitSeconds()
83+
* @method int|null getMaxTemporaryLockouts()
8284
* @method int|null getMinimumQuickLoginWaitSeconds()
8385
* @method int|null getNotBefore()
8486
* @method int|null getOauth2DeviceCodeLifespan()
@@ -193,7 +195,8 @@
193195
* @method self withEventsExpiration(?int $value)
194196
* @method self withEventsListeners(?array $value)
195197
* @method self withFailureFactor(?int $value)
196-
* @method self withFederatedUsers(?array $value)
198+
* @method self withFederatedUsers(?UserCollection $value)
199+
* @method self withFirstBrokerLoginFlow(?string $value)
197200
* @method self withGroups(?GroupCollection $value)
198201
* @method self withId(?string $value)
199202
* @method self withIdentityProviderMappers(?array $value)
@@ -204,6 +207,7 @@
204207
* @method self withLoginWithEmailAllowed(?bool $value)
205208
* @method self withMaxDeltaTimeSeconds(?int $value)
206209
* @method self withMaxFailureWaitSeconds(?int $value)
210+
* @method self withMaxTemporaryLockouts(?int $value)
207211
* @method self withMinimumQuickLoginWaitSeconds(?int $value)
208212
* @method self withNotBefore(?int $value)
209213
* @method self withOauth2DeviceCodeLifespan(?int $value)
@@ -330,6 +334,8 @@ public function __construct(
330334
protected ?array $eventsListeners = null,
331335
protected ?int $failureFactor = null,
332336
protected ?UserCollection $federatedUsers = null,
337+
#[Since('24.0.0')]
338+
protected ?string $firstBrokerLoginFlow = null,
333339
protected ?GroupCollection $groups = null,
334340
protected ?string $id = null,
335341
protected ?IdentityProviderMapperCollection $identityProviderMappers = null,
@@ -340,6 +346,8 @@ public function __construct(
340346
protected ?bool $loginWithEmailAllowed = null,
341347
protected ?int $maxDeltaTimeSeconds = null,
342348
protected ?int $maxFailureWaitSeconds = null,
349+
#[Since('24.0.0')]
350+
protected ?int $maxTemporaryLockouts = null,
343351
protected ?int $minimumQuickLoginWaitSeconds = null,
344352
protected ?int $notBefore = null,
345353
protected ?int $oauth2DeviceCodeLifespan = null,

tests/Unit/Http/PropertyFilterTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,6 @@ public static function supportedKeycloakVersions(): Generator
102102
yield ['21.0.0'];
103103
yield ['22.0.0'];
104104
yield ['23.0.0'];
105+
yield ['24.0.0'];
105106
}
106107
}

0 commit comments

Comments
 (0)