From 44267862bc4fb23ced04eba6a3755ba76a8b3cca Mon Sep 17 00:00:00 2001 From: Torsten Juergeleit Date: Tue, 30 Jul 2024 20:08:54 +0200 Subject: [PATCH] removes obsolete configuration for page nesting --- .../confluence/ConfluenceGroupLDAPStorageMapperFactory.java | 6 ------ .../mappers/confluence/content/ConfluenceContentConfig.java | 6 ------ .../confluence/content/ConfluenceContentProviderIT.java | 1 - 3 files changed, 13 deletions(-) diff --git a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapperFactory.java b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapperFactory.java index 9fd9f3b..8c2a1c5 100644 --- a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapperFactory.java +++ b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapperFactory.java @@ -61,7 +61,6 @@ public List getConfigProperties() { .property().name(BASE_URL).label("Base URL").helpText("Base URL of the Confluence Server (with context path - if any)").type(ProviderConfigProperty.STRING_TYPE).required(true).add() .property().name(AUTH_TOKEN).label("Bearer Token").helpText("Personal access token for API authentication").type(ProviderConfigProperty.PASSWORD).secret(true).required(true).add() .property().name(PARENT_PAGE_ID).label("Parent Page ID").helpText("ID of parent page the child pages are retrieved from").type(ProviderConfigProperty.STRING_TYPE).required(true).add() - .property().name(PAGE_NESTING).label("Page Nesting Depth").helpText("Max depth of nested child pages").type(ProviderConfigProperty.STRING_TYPE).defaultValue(ConfluenceContentConfig.DEFAULT_PAGE_NESTING).required(true).add() .property().name(SPACE_KEY).label("Space Key").helpText("Key of Confluence space the pages are belonging to").type(ProviderConfigProperty.STRING_TYPE).required(true).add() .property().name(PAGE_LABELS).label("Page Label(s)").helpText("Comma-separated list of labels required for the pages").type(ProviderConfigProperty.STRING_TYPE).add() .property().name(PAGE_PROPERTY_NAME).label("Page Property Name").helpText("Name of page property with the table holding the group members ").type(ProviderConfigProperty.STRING_TYPE).required(true).add() @@ -76,7 +75,6 @@ public void validateConfiguration(KeycloakSession session, RealmModel realm, Com checkMandatoryConfigAttribute(BASE_URL, "Base URL", config); checkMandatoryConfigAttribute(AUTH_TOKEN, "Bearer Token", config); checkMandatoryConfigAttribute(PARENT_PAGE_ID, "Parent Page ID", config); - checkMandatoryConfigAttribute(PAGE_NESTING, "Page Nesting Depth", config); checkMandatoryConfigAttribute(SPACE_KEY, "Space Key", config); checkMandatoryConfigAttribute(PAGE_PROPERTY_NAME, "Page Property Name", config); checkMandatoryConfigAttribute(MEMBER_COLUMN_INDEX, "Member Column Index", config); @@ -86,10 +84,6 @@ public void validateConfiguration(KeycloakSession session, RealmModel realm, Com if (baseUrl.trim().endsWith("/")) { throw new ComponentValidationException("No trailing slash in Base URL allowed"); } - int pageNesting = new ConfluenceContentConfig(config).getPageNesting(); - if (pageNesting <= 0 || pageNesting > 99) { - throw new ComponentValidationException("Invalid page nesting depth - must be > 0 and < 100"); - } int memberColumnIndex = new ConfluenceContentConfig(config).getMemberColumnIndex(); if (memberColumnIndex <= 0 || memberColumnIndex > 99) { throw new ComponentValidationException("Invalid member column index - must be > 0 and < 100"); diff --git a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentConfig.java b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentConfig.java index 10292e0..1af9803 100644 --- a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentConfig.java +++ b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentConfig.java @@ -6,8 +6,6 @@ public class ConfluenceContentConfig { public static final String BASE_URL = "confluenceContent.baseUrl"; public static final String AUTH_TOKEN = "confluenceContent.authToken"; public static final String PARENT_PAGE_ID = "confluenceContent.parentPageId"; - public static final String PAGE_NESTING = "confluenceContent.pageNesting"; - public static final int DEFAULT_PAGE_NESTING = 3; public static final String SPACE_KEY = "confluenceContent.spaceKey"; public static final String PAGE_PROPERTY_NAME = "confluenceContent.pagePropertyName"; public static final String PAGE_LABELS = "confluenceContent.pageLabels"; @@ -31,10 +29,6 @@ public String getParentPageId() { return model.get(PARENT_PAGE_ID).trim(); } - public int getPageNesting() { - return model.get(PAGE_NESTING, DEFAULT_PAGE_NESTING); - } - public String getSpaceKey() { return model.get(SPACE_KEY).trim(); } diff --git a/src/test/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentProviderIT.java b/src/test/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentProviderIT.java index 5ac0a3e..9f59fe2 100644 --- a/src/test/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentProviderIT.java +++ b/src/test/java/org/vaulttec/keycloak/ldap/mappers/confluence/content/ConfluenceContentProviderIT.java @@ -40,7 +40,6 @@ static void setup() throws Exception { when(model.get(BASE_URL)).thenReturn(mockEndpoint.toString()); when(model.get(AUTH_TOKEN)).thenReturn("token"); when(model.get(PARENT_PAGE_ID)).thenReturn("1234"); - when(model.get(PAGE_NESTING, DEFAULT_PAGE_NESTING)).thenReturn(4); when(model.get(SPACE_KEY)).thenReturn("TEST"); when(model.get(PAGE_LABELS)).thenReturn("label1 , label2 , lbl-test"); when(model.get(PAGE_PROPERTY_NAME)).thenReturn("Members");