Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Sep 27, 2023
1 parent 07e180d commit 09c8178
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public function transform(object $data, string $resourceClass, array $context =
if (null !== $data->slug) {
$object->setSlug($data->slug);
}
if (null !== $data->public) {
$object->setPublic($data->public);
}
if (null !== $data->enabledLocales) {
$object->setEnabledLocales(array_values($data->enabledLocales));
}
Expand Down
1 change: 1 addition & 0 deletions databox/api/src/Api/Model/Input/WorkspaceInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class WorkspaceInput extends AbstractOwnerIdInput
{
public ?string $name = null;
public ?string $slug = null;
public ?bool $public = null;
public ?array $enabledLocales = null;
public ?array $localeFallbacks = null;
}
2 changes: 1 addition & 1 deletion lib/php/auth-bundle/Client/KeycloakClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function createUser(array $data, string $accessToken): array
]);

if (empty($users)) {
throw new \RuntimeException(sprintf('Cannot find newly created user. Please check client permissions!'));
throw new \RuntimeException('Cannot find newly created user. Please check client permissions!');
}

return $users[0];
Expand Down
2 changes: 1 addition & 1 deletion lib/php/auth-bundle/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public function getAclUsers(int $limit = null, int $offset = 0): array
*/
public function getAclGroupsId(AclUserInterface $user): array
{
return $user->getGroupIds();
return $user->getGroups();
}
}
6 changes: 6 additions & 0 deletions lib/php/core-bundle/Fixture/Faker/KeycloakFaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function __construct(
public function keycloakUser(
string $username,
array $roles = [],
string $password = 'xxx',
): string {
if (null === $this->accessToken) {
['access_token' => $this->accessToken] = $this->keycloakClient->getClientCredentialAccessToken();
Expand All @@ -36,6 +37,11 @@ public function keycloakUser(
'emailVerified' => true,
'enabled' => true,
'realmRoles' => $roles,
'credentials' => [[
'type' => 'password',
'value' => $password,
'temporary' => true,
]]
], $this->accessToken);

return $response['id'];
Expand Down

0 comments on commit 09c8178

Please sign in to comment.