Skip to content

Commit 9f6ee5f

Browse files
chore(identity): rename C8 component identity to admin (#1003)
related to camunda/camunda#44432
1 parent e5e8fc4 commit 9f6ee5f

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

data-migrator/core/src/main/java/io/camunda/migration/data/impl/identity/AuthorizationManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ protected Set<String> mapApplicationToComponentId(String applicationId) {
186186
case WILDCARD -> Set.of(WILDCARD);
187187
case "cockpit" -> Set.of("operate");
188188
case "tasklist" -> Set.of("tasklist");
189-
case "admin" -> Set.of("identity");
189+
case "admin" -> Set.of("admin");
190190
default -> Set.of();
191191
};
192192
}

data-migrator/qa/integration-tests/src/test/java/io/camunda/migration/data/qa/identity/AuthorizationMigrationTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,26 @@ public void shouldMigrateTwoAuthorizationsForEachDefinitionAuthorization() {
278278
assertAuthorizationsSatisfy(authorizations, ResourceType.DECISION_DEFINITION, "decDefKey", USER, USERNAME, getAllSupportedPerms(ResourceType.DECISION_DEFINITION));
279279
assertAuthorizationsSatisfy(authorizations, ResourceType.DECISION_DEFINITION, prefixDefinitionId("decDefKey"), USER, USERNAME, getAllSupportedPerms(ResourceType.DECISION_DEFINITION));
280280
}
281+
282+
@Test
283+
public void shouldMigrateApplicationAuthorizationsWithCorrectResourceId() {
284+
// given
285+
testHelper.createAuthorizationInC7(AUTH_TYPE_GRANT, USERNAME, null, Resources.APPLICATION, "cockpit", Set.of(Permissions.ALL));
286+
testHelper.createAuthorizationInC7(AUTH_TYPE_GRANT, USERNAME, null, Resources.APPLICATION, "tasklist", Set.of(Permissions.ALL));
287+
testHelper.createAuthorizationInC7(AUTH_TYPE_GRANT, USERNAME, null, Resources.APPLICATION, "admin", Set.of(Permissions.ALL));
288+
testHelper.createAuthorizationInC7(AUTH_TYPE_GRANT, USERNAME, null, Resources.APPLICATION, "*", Set.of(Permissions.ALL));
289+
Authorization invalidAuth = testHelper.createAuthorizationInC7(AUTH_TYPE_GRANT, USERNAME, null, Resources.APPLICATION, "invalid", Set.of(Permissions.ALL));
290+
291+
// when
292+
identityMigrator.start();
293+
294+
// then
295+
var authorizations = testHelper.awaitAuthorizationsCountAndGet(4, USERNAME);
296+
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "operate", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
297+
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "tasklist", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
298+
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "admin", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
299+
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "*", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
300+
testHelper.verifyAuthorizationSkippedViaLogs(invalidAuth.getId(), format(FAILURE_UNSUPPORTED_RESOURCE_ID, "invalid", Resources.APPLICATION.resourceName()), logs);
301+
}
281302

282303
}

data-migrator/qa/integration-tests/src/test/java/io/camunda/migration/data/qa/identity/RetryAuthorizationMigrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void shouldMigrateSkippedAuthorizationsOnRetry() {
7373
// then all three authorizations are migrated successfully
7474
var authorizations = testHelper.awaitAuthorizationsCountAndGet(3, USERNAME);
7575
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "operate", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
76-
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "identity", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
76+
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "admin", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
7777
assertAuthorizationsSatisfy(authorizations, ResourceType.COMPONENT, "tasklist", USER, USERNAME, getAllSupportedPerms(ResourceType.COMPONENT));
7878
}
7979

0 commit comments

Comments
 (0)