Skip to content

Commit 5b0121c

Browse files
authored
Merge pull request #1190 from eclipse-tractusx/release/v2.3.0-RC4
build(2.3.0-rc4): bump version and update docs
2 parents a49ff30 + 3e54d85 commit 5b0121c

35 files changed

+2231
-378
lines changed

.tractusx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
leadingRepository: "https://github.com/eclipse-tractusx/portal"
2121
openApiSpecs:
22-
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC3/docs/api/administration-service.yaml"
23-
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC3/docs/api/apps-service.yaml"
24-
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC3/docs/api/notifications-service.yaml"
25-
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC3/docs/api/registration-service.yaml"
26-
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC3/docs/api/services-service.yaml"
22+
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC4/docs/api/administration-service.yaml"
23+
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC4/docs/api/apps-service.yaml"
24+
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC4/docs/api/notifications-service.yaml"
25+
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC4/docs/api/registration-service.yaml"
26+
- "https://raw.githubusercontent.com/eclipse-tractusx/portal-backend/refs/tags/v2.3.0-RC4/docs/api/services-service.yaml"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ New features, fixed bugs, known defects and other noteworthy changes to each rel
44

55
## Unreleased
66

7+
## 2.3.0-RC4
8+
9+
### Change
10+
11+
* **Keycloak realm seeding job**: made seeder configurable [#1174](https://github.com/eclipse-tractusx/portal-backend/pull/1174)
12+
713
## 2.3.0-RC3
814

915
### Technical Support

docs/api/administration-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Org.Eclipse.TractusX.Portal.Backend.Administration.Service
4-
version: v2.3.0-RC3
4+
version: v2.3.0-RC4
55
paths:
66
/api/administration/companydata/ownCompanyDetails:
77
get:

docs/api/apps-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Org.Eclipse.TractusX.Portal.Backend.Apps.Service
4-
version: v2.3.0-RC3
4+
version: v2.3.0-RC4
55
paths:
66
'/api/apps/AppChange/{appId}/role/activeapp':
77
post:

docs/api/notifications-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Org.Eclipse.TractusX.Portal.Backend.Notifications.Service
4-
version: v2.3.0-RC3
4+
version: v2.3.0-RC4
55
paths:
66
/api/notification/errormessage:
77
get:

docs/api/registration-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Org.Eclipse.TractusX.Portal.Backend.Registration.Service
4-
version: v2.3.0-RC3
4+
version: v2.3.0-RC4
55
paths:
66
/api/registration/errormessage:
77
get:

docs/api/services-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
openapi: 3.0.1
22
info:
33
title: Org.Eclipse.TractusX.Portal.Backend.Services.Service
4-
version: v2.3.0-RC3
4+
version: v2.3.0-RC4
55
paths:
66
/api/services/errormessage:
77
get:

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
<Project>
2121
<PropertyGroup>
2222
<VersionPrefix>2.3.0</VersionPrefix>
23-
<VersionSuffix>RC3</VersionSuffix>
23+
<VersionSuffix>RC4</VersionSuffix>
2424
</PropertyGroup>
2525
</Project>

src/keycloak/Keycloak.Seeding/BusinessLogic/AuthenticationFlowsUpdater.cs

Lines changed: 86 additions & 86 deletions
Large diffs are not rendered by default.

src/keycloak/Keycloak.Seeding/BusinessLogic/ClientScopeMapperUpdater.cs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,22 @@
2222
using Org.Eclipse.TractusX.Portal.Backend.Keycloak.Factory;
2323
using Org.Eclipse.TractusX.Portal.Backend.Keycloak.Library;
2424
using Org.Eclipse.TractusX.Portal.Backend.Keycloak.Library.Models.Roles;
25+
using Org.Eclipse.TractusX.Portal.Backend.Keycloak.Seeding.Extensions;
26+
using Org.Eclipse.TractusX.Portal.Backend.Keycloak.Seeding.Models;
2527

2628
namespace Org.Eclipse.TractusX.Portal.Backend.Keycloak.Seeding.BusinessLogic;
2729

28-
public class ClientScopeMapperUpdater : IClientScopeMapperUpdater
30+
public class ClientScopeMapperUpdater(IKeycloakFactory keycloakFactory, ISeedDataHandler seedDataHandler)
31+
: IClientScopeMapperUpdater
2932
{
30-
private readonly IKeycloakFactory _keycloakFactory;
31-
private readonly ISeedDataHandler _seedData;
32-
33-
public ClientScopeMapperUpdater(IKeycloakFactory keycloakFactory, ISeedDataHandler seedDataHandler)
34-
{
35-
_keycloakFactory = keycloakFactory;
36-
_seedData = seedDataHandler;
37-
}
38-
3933
public async Task UpdateClientScopeMapper(string instanceName, CancellationToken cancellationToken)
4034
{
41-
var keycloak = _keycloakFactory.CreateKeycloakClient(instanceName);
42-
var realm = _seedData.Realm;
35+
var keycloak = keycloakFactory.CreateKeycloakClient(instanceName);
36+
var realm = seedDataHandler.Realm;
37+
var seederConfig = seedDataHandler.GetSpecificConfiguration(ConfigurationKey.ClientScopes);
4338

4439
var clients = await keycloak.GetClientsAsync(realm, null, true, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
45-
foreach (var (clientName, mappingModels) in _seedData.ClientScopeMappings)
40+
foreach (var (clientName, mappingModels) in seedDataHandler.ClientScopeMappings)
4641
{
4742
var client = clients.SingleOrDefault(x => x.ClientId == clientName);
4843
if (client?.Id is null)
@@ -60,17 +55,23 @@ public async Task UpdateClientScopeMapper(string instanceName, CancellationToken
6055
}
6156
var clientRoles = await keycloak.GetClientRolesScopeMappingsForClientAsync(realm, clientScope.Id, client.Id, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
6257
var mappingModelRoles = mappingModel.Roles?.Select(roleName => roles.SingleOrDefault(r => r.Name == roleName) ?? throw new ConflictException($"No role with name {roleName} found")) ?? Enumerable.Empty<Role>();
63-
await AddAndDeleteRoles(keycloak, realm, clientScope.Id, client.Id, clientRoles, mappingModelRoles, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
58+
await AddAndDeleteRoles(keycloak, realm, clientScope.Id, client.Id, clientRoles, mappingModelRoles, seederConfig, cancellationToken).ConfigureAwait(ConfigureAwaitOptions.None);
6459
}
6560
}
6661
}
6762

68-
private static async Task AddAndDeleteRoles(KeycloakClient keycloak, string realm, string clientScopeId, string clientId, IEnumerable<Role> roles, IEnumerable<Role> updateRoles, CancellationToken cancellationToken)
63+
private static async Task AddAndDeleteRoles(KeycloakClient keycloak, string realm, string clientScopeId, string clientId, IEnumerable<Role> roles, IEnumerable<Role> updateRoles, KeycloakSeederConfigModel seederConfig, CancellationToken cancellationToken)
6964
{
70-
await updateRoles.ExceptBy(roles.Select(role => role.Name), roleModel => roleModel.Name).IfAnyAwait(rolesToAdd =>
71-
keycloak.AddClientRolesScopeMappingToClientAsync(realm, clientScopeId, clientId, rolesToAdd, cancellationToken)).ConfigureAwait(false);
65+
await updateRoles
66+
.Where(x => seederConfig.ModificationAllowed(ModificationType.Create, x.Name))
67+
.ExceptBy(roles.Select(role => role.Name), roleModel => roleModel.Name)
68+
.IfAnyAwait(rolesToAdd =>
69+
keycloak.AddClientRolesScopeMappingToClientAsync(realm, clientScopeId, clientId, rolesToAdd, cancellationToken)).ConfigureAwait(false);
7270

73-
await roles.ExceptBy(updateRoles.Select(roleModel => roleModel.Name), role => role.Name).IfAnyAwait(rolesToDelete =>
74-
keycloak.RemoveClientRolesFromClientScopeForClientAsync(realm, clientScopeId, clientId, rolesToDelete, cancellationToken)).ConfigureAwait(false);
71+
await roles
72+
.Where(x => seederConfig.ModificationAllowed(ModificationType.Delete, x.Name))
73+
.ExceptBy(updateRoles.Select(roleModel => roleModel.Name), role => role.Name)
74+
.IfAnyAwait(rolesToDelete =>
75+
keycloak.RemoveClientRolesFromClientScopeForClientAsync(realm, clientScopeId, clientId, rolesToDelete, cancellationToken)).ConfigureAwait(false);
7576
}
7677
}

0 commit comments

Comments
 (0)