Skip to content

Commit 3b909a7

Browse files
authored
Merge pull request #111 from fschmtt/keycloak-25
Add support for Keycloak 25 #110
2 parents 308cc8d + 1b3c107 commit 3b909a7

File tree

10 files changed

+98
-12
lines changed

10 files changed

+98
-12
lines changed

Diff for: .github/workflows/php-integration.yml

+2-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, 24.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, 25.0.0]
1616
php: [ 8.1 ]
1717

1818
env:
@@ -50,6 +50,7 @@ jobs:
5050
uses: iFaxity/wait-on-action@v1
5151
with:
5252
resource: ${{ env.KEYCLOAK_BASE_URL }}
53+
httpTimeout: 30000
5354

5455
- name: Wait some more for Keycloak 24.0.0 zZz
5556
if: ${{ matrix.keycloak == '24.0.0' }}

Diff for: README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Keycloak Admin REST API Client
88

9-
PHP client to interact with [Keycloak's Admin REST API](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html).
9+
PHP client to interact with [Keycloak's Admin REST API](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html).
1010

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

@@ -49,7 +49,7 @@ echo sprintf(
4949
will print e.g.
5050

5151
```text
52-
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.
52+
Keycloak 25.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.
5353
```
5454

5555
More examples can be found in the [examples](examples) directory.
@@ -104,15 +104,15 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
104104

105105
## Available Resources
106106

107-
### [Attack Detection](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_attack_detection)
107+
### [Attack Detection](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_attack_detection)
108108

109109
| Endpoint | Response | API |
110110
|----------------------------------------------------------------------------|-------------------------|-------------------------------------------------------------------|
111111
| `DELETE /admin/realms/{realm}/attack-detection/brute-force/users` | `n/a` | [AttackDetection::clear()](src/Resource/AttackDetection.php) |
112112
| `GET /admin/realms/{realm}/attack-detection/brute-force/users/{userId}` | [Map](src/Type/Map.php) | [AttackDetection::userStatus()](src/Resource/AttackDetection.php) |
113113
| `DELETE /admin/realms/{realm}/attack-detection/brute-force/users/{userId}` | `n/a` | [AttackDetection::clearUser()](src/Resource/AttackDetection.php) |
114114

115-
### [Clients](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_clients)
115+
### [Clients](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_clients)
116116

117117
| Endpoint | Response | API |
118118
|---------------------------------------------------|---------------------------------------------------------|-----------------------------------------------|
@@ -121,7 +121,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
121121
| `PUT /admin/realms/{realm}/clients/{client-uuid}` | [Client](src/Representation/Client.php) | [Clients::update()](src/Resource/Clients.php) |
122122
| `POST /admin/realms/{realm}/clients` | [Client](src/Representation/Client.php) | [Clients::import()](src/Resource/Clients.php) |
123123

124-
### [Groups](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_clients)
124+
### [Groups](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_clients)
125125

126126
| Endpoint | Response | API |
127127
|---------------------------------------------------|-------------------------------------------------------|-----------------------------------------------|
@@ -133,7 +133,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
133133
| `POST /admin/realms/{realm}/groups/{id}/children` | `n/a` | [Groups::create()](src/Resource/Groups.php) |
134134
| `DELETE /admin/realms/{realm}/groups` | `n/a` | [Groups::delete()](src/Resource/Groups.php) |
135135

136-
### [Realms Admin](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_realms_admin)
136+
### [Realms Admin](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_realms_admin)
137137

138138
| Endpoint | Response | API |
139139
|------------------------------------------------|-------------------------------------------------------|--------------------------------------------------------|
@@ -148,7 +148,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
148148
| `POST /admin/realms/{realm}/clear-realm-cache` | `n/a` | [Realms::clearRealmCache()](src/Resource/Realms.php) |
149149
| `POST /admin/realms/{realm}/clear-user-cache` | `n/a` | [Realms::clearUserCache()](src/Resource/Realms.php) |
150150

151-
### [Users](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_users)
151+
### [Users](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_users)
152152

153153
| Endpoint | Response | API |
154154
|---------------------------------------------------------|-----------------------------------------------------------------|----------------------------------------------------------------|
@@ -168,7 +168,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
168168
| `PUT /{realm}/users/{id}/execute-actions-email` | `n/a` | [Users::executeActionsEmail()](src/Resource/Users.php) |
169169
| `GET /admin/realms/{realm}/users/{userId}/credentials` | [CredentialCollection](src/Collection/CredentialCollection.php) | [Users::credentials()](src/Resource/Users.php) |
170170

171-
### [Roles](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_roles)
171+
### [Roles](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_roles)
172172

173173
| Endpoint | Response | API |
174174
|-------------------------------------------------|-----------------------------------------------------|-------------------------------------------|
@@ -177,7 +177,7 @@ $myCustomRepresentation = $myCustomResource->myCustomEndpoint();
177177
| `POST /admin/realms/{realm}/roles` | `n/a` | [Roles::create()](src/Resource/Roles.php) |
178178
| `DELETE /admin/realms/{realm}/roles/{roleName}` | `n/a` | [Roles::delete()](src/Resource/Roles.php) |
179179

180-
### [Root](https://www.keycloak.org/docs-api/24.0.0/rest-api/index.html#_root)
180+
### [Root](https://www.keycloak.org/docs-api/25.0.0/rest-api/index.html#_root)
181181

182182
| Endpoint | Response | API |
183183
|-------------------------|-------------------------------------------------|--------------------------------------------------|

Diff for: docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
working_dir: /app
99

1010
keycloak:
11-
image: quay.io/keycloak/keycloak:24.0.0
11+
image: quay.io/keycloak/keycloak:25.0.0
1212
command: start-dev
1313
environment:
1414
KEYCLOAK_ADMIN: admin

Diff for: docker/keycloak/Dockerfile

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

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

Diff for: src/Collection/OrganizationCollection.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Collection;
6+
7+
use Fschmtt\Keycloak\Representation\Organization;
8+
9+
/**
10+
* @extends Collection<Organization>
11+
*
12+
* @codeCoverageIgnore
13+
*/
14+
class OrganizationCollection extends Collection
15+
{
16+
public static function getRepresentationClass(): string
17+
{
18+
return Organization::class;
19+
}
20+
}

Diff for: src/Collection/OrganizationDomainCollection.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Collection;
6+
7+
use Fschmtt\Keycloak\Representation\OrganizationDomain;
8+
9+
/**
10+
* @extends Collection<OrganizationDomain>
11+
*
12+
* @codeCoverageIgnore
13+
*/
14+
class OrganizationDomainCollection extends Collection
15+
{
16+
public static function getRepresentationClass(): string
17+
{
18+
return OrganizationDomain::class;
19+
}
20+
}

Diff for: src/Representation/Organization.php

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Representation;
6+
7+
use Fschmtt\Keycloak\Collection\IdentityProviderCollection;
8+
use Fschmtt\Keycloak\Collection\OrganizationDomainCollection;
9+
use Fschmtt\Keycloak\Collection\UserCollection;
10+
use Fschmtt\Keycloak\Type\Map;
11+
12+
class Organization extends Representation
13+
{
14+
public function __construct(
15+
protected ?string $id = null,
16+
protected ?string $name = null,
17+
protected ?bool $enabled = null,
18+
protected ?string $description = null,
19+
protected ?Map $attributes = null,
20+
protected ?OrganizationDomainCollection $domains = null,
21+
protected ?UserCollection $members = null,
22+
protected ?IdentityProviderCollection $identityProviders = null,
23+
) {
24+
}
25+
}

Diff for: src/Representation/OrganizationDomain.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Fschmtt\Keycloak\Representation;
6+
7+
class OrganizationDomain extends Representation
8+
{
9+
public function __construct(
10+
protected ?string $name = null,
11+
protected ?bool $verified = null,
12+
) {
13+
}
14+
}

Diff for: src/Representation/Realm.php

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Fschmtt\Keycloak\Collection\GroupCollection;
1313
use Fschmtt\Keycloak\Collection\IdentityProviderCollection;
1414
use Fschmtt\Keycloak\Collection\IdentityProviderMapperCollection;
15+
use Fschmtt\Keycloak\Collection\OrganizationCollection;
1516
use Fschmtt\Keycloak\Collection\ProtocolMapperCollection;
1617
use Fschmtt\Keycloak\Collection\RequiredActionProviderCollection;
1718
use Fschmtt\Keycloak\Collection\ScopeMappingCollection;
@@ -355,6 +356,10 @@ public function __construct(
355356
protected ?int $offlineSessionIdleTimeout = null,
356357
protected ?int $offlineSessionMaxLifespan = null,
357358
protected ?bool $offlineSessionMaxLifespanEnabled = null,
359+
#[Since('25.0.0')]
360+
protected ?OrganizationCollection $organizations = null,
361+
#[Since('25.0.0')]
362+
protected ?bool $organizationsEnabled = null,
358363
protected ?string $otpPolicyAlgorithm = null,
359364
#[Since('20.0.0')]
360365
protected ?bool $otpPolicyCodeReusable = null,

Diff for: tests/Unit/Http/PropertyFilterTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,6 @@ public static function supportedKeycloakVersions(): Generator
9898
yield ['22.0.0'];
9999
yield ['23.0.0'];
100100
yield ['24.0.0'];
101+
yield ['25.0.0'];
101102
}
102103
}

0 commit comments

Comments
 (0)