Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pathob committed May 15, 2024
1 parent ef2a12b commit 651f00d
Show file tree
Hide file tree
Showing 6 changed files with 714 additions and 82 deletions.
79 changes: 79 additions & 0 deletions index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4401,12 +4401,91 @@ endif::internal-generation[]
|
|

| cachedDirectoriesAuthenticationOrderOptimisationEnabled
|
| Boolean
|
|

| directoryMappings
|
| List of <<ApplicationDirectoryMapping>>
|
|

| accessBasedSynchronisation
|
| String
|
| _Enum:_ NO_FILTERING, USER_ONLY_FILTERING, USER_AND_GROUP_FILTERING,

| membershipAggregationEnabled
|
| Boolean
|
|

| remoteAddresses
|
| List of <<string>>
|
|

| aliasingEnabled
|
| Boolean
|
|

| lowercaseOutputEnabled
|
| Boolean
|
|

|===


[#ApplicationDirectoryMapping]
=== _ApplicationDirectoryMapping_



[.fields-ApplicationDirectoryMapping]
[cols="2,1,2,4,1"]
|===
| Field Name| Required| Type| Description| Format

| directoryName
|
| String
|
|

| authenticationAllowAll
|
| Boolean
|
|

| authenticationGroups
|
| List of <<string>>
|
|

| autoAssignmentGroups
|
| List of <<string>>
|
|

| allowedOperations
|
| List of <<string>>
|
| _Enum:_

|===


Expand Down
83 changes: 77 additions & 6 deletions src/main/java/de/aservo/confapi/crowd/model/ApplicationBean.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package de.aservo.confapi.crowd.model;

import com.atlassian.crowd.embedded.api.OperationType;
import de.aservo.confapi.commons.constants.ConfAPI;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import java.util.*;
import java.util.Collection;
import java.util.Collections;

@Data
@NoArgsConstructor
Expand All @@ -27,6 +28,13 @@ public enum ApplicationType {
;
}

public enum AccessBasedSynchronisation {
NO_FILTERING,
USER_ONLY_FILTERING,
USER_AND_GROUP_FILTERING,
;
}

@XmlElement
private Long id;

Expand All @@ -45,31 +53,94 @@ public enum ApplicationType {
@XmlElement
private String password;

@XmlElement
private Boolean cachedDirectoriesAuthenticationOrderOptimisationEnabled;

@XmlElement
private Collection<ApplicationDirectoryMapping> directoryMappings;

@XmlElement
private AccessBasedSynchronisation accessBasedSynchronisation;

@XmlElement
private Boolean membershipAggregationEnabled;

@XmlElement
private Collection<String> remoteAddresses;

@XmlElement
private Boolean aliasingEnabled;

@XmlElement
private Boolean lowercaseOutputEnabled;

@Data
@NoArgsConstructor
public static class ApplicationDirectoryMapping {

@XmlElement
private String directoryName;

@XmlElement
private Boolean authenticationAllowAll;

@XmlElement
private Collection<String> authenticationGroups;

@XmlElement
private Collection<String> autoAssignmentGroups;

@XmlElement
private Collection<OperationType> allowedOperations;

}

public static final ApplicationBean EXAMPLE_1;
public static final ApplicationBean EXAMPLE_2;

static {
EXAMPLE_1 = new ApplicationBean();
EXAMPLE_1.setId(1L);
EXAMPLE_1.setName("app_name");
EXAMPLE_1.setDescription("app_description");
EXAMPLE_1.setActive(true);
EXAMPLE_1.setPassword("3x4mpl3");
EXAMPLE_1.setType(ApplicationType.GENERIC);
EXAMPLE_1.setId(1L);
EXAMPLE_1.setPassword("3x4mpl3");
EXAMPLE_1.setCachedDirectoriesAuthenticationOrderOptimisationEnabled(false);
final ApplicationDirectoryMapping directoryMapping = new ApplicationDirectoryMapping();
directoryMapping.setDirectoryName("directory");
directoryMapping.setAuthenticationAllowAll(true);
directoryMapping.setAuthenticationGroups(Collections.singleton("app_access"));
directoryMapping.setAutoAssignmentGroups(Collections.singleton("app_users"));
directoryMapping.setAllowedOperations(Collections.singleton(OperationType.CREATE_USER));
EXAMPLE_1.setDirectoryMappings(Collections.singleton(directoryMapping));
EXAMPLE_1.setAccessBasedSynchronisation(AccessBasedSynchronisation.NO_FILTERING);
EXAMPLE_1.setMembershipAggregationEnabled(false);
EXAMPLE_1.setRemoteAddresses(Collections.singletonList("127.0.0.1"));
EXAMPLE_1.setAliasingEnabled(true);
EXAMPLE_1.setLowercaseOutputEnabled(true);
}

static {
EXAMPLE_2 = new ApplicationBean();
EXAMPLE_2.setId(2L);
EXAMPLE_2.setName("app_name2");
EXAMPLE_2.setDescription("app_description2");
EXAMPLE_2.setActive(false);
EXAMPLE_2.setPassword("3x4mpl32");
EXAMPLE_2.setType(ApplicationType.BAMBOO);
EXAMPLE_2.setId(2L);
EXAMPLE_2.setPassword("3x4mpl32");
EXAMPLE_2.setCachedDirectoriesAuthenticationOrderOptimisationEnabled(true);
final ApplicationDirectoryMapping directoryMapping = new ApplicationDirectoryMapping();
directoryMapping.setDirectoryName("directory");
directoryMapping.setAuthenticationAllowAll(false);
directoryMapping.setAuthenticationGroups(Collections.singleton("app_access2"));
directoryMapping.setAutoAssignmentGroups(Collections.singleton("app_users2"));
directoryMapping.setAllowedOperations(Collections.singleton(OperationType.CREATE_GROUP));
EXAMPLE_2.setDirectoryMappings(Collections.singleton(directoryMapping));
EXAMPLE_2.setAccessBasedSynchronisation(AccessBasedSynchronisation.USER_AND_GROUP_FILTERING);
EXAMPLE_2.setMembershipAggregationEnabled(true);
EXAMPLE_2.setRemoteAddresses(Collections.singletonList("127.0.0.3"));
EXAMPLE_2.setAliasingEnabled(false);
EXAMPLE_2.setLowercaseOutputEnabled(false);
}
}
Loading

0 comments on commit 651f00d

Please sign in to comment.