Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applications: Allow setting all attributes #72

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4401,12 +4401,97 @@ 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
|
|

| authenticationWithoutPasswordEnabled
|
| 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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>confapi-crowd-plugin</artifactId>
<version>0.5.3-SNAPSHOT</version>
<version>0.6.0-SNAPSHOT</version>
<packaging>atlassian-plugin</packaging>

<name>ConfAPI for Crowd</name>
Expand Down
88 changes: 82 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,99 @@ 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;

@XmlElement
private Boolean authenticationWithoutPasswordEnabled;

@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);
EXAMPLE_1.setAuthenticationWithoutPasswordEnabled(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);
EXAMPLE_2.setAuthenticationWithoutPasswordEnabled(false);
}
}
Loading
Loading