Skip to content

Commit

Permalink
removes obsolete configuration for page nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
tjuerge committed Jul 30, 2024
1 parent bf164c6 commit 4426786
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public List<ProviderConfigProperty> 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()
Expand All @@ -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);
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 4426786

Please sign in to comment.