Skip to content

Commit

Permalink
Adding minimal scim2 connector
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan committed May 8, 2020
1 parent d10aeeb commit 38bc87c
Show file tree
Hide file tree
Showing 19 changed files with 2,552 additions and 17 deletions.
509 changes: 509 additions & 0 deletions connector-amqp-import/amqp.xml

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions connector-amqp-import/amqp2.xml

Large diffs are not rendered by default.

510 changes: 510 additions & 0 deletions connector-amqp-import/amqp3.xml

Large diffs are not rendered by default.

508 changes: 508 additions & 0 deletions connector-amqp-import/amqp4.xml

Large diffs are not rendered by default.

405 changes: 405 additions & 0 deletions connector-amqp-import/backup/amqp-import.xml

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion connector-amqp-import/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>edu.unc.polygon</groupId>
<artifactId>connector-amqp-import</artifactId>
<version>0.3-SNAPSHOT</version>
<version>0.4-SNAPSHOT</version>
<packaging>jar</packaging>

<name>AMQP Connector</name>
Expand Down
35 changes: 27 additions & 8 deletions connector-amqp-import/samples/amqp-import.xml
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="fullname" type="xsd:string">
<xsd:element minOccurs="0" name="fullName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>270</a:displayOrder>
<ra:frameworkAttributeName>fullname</ra:frameworkAttributeName>
<ra:frameworkAttributeName>fullName</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down Expand Up @@ -325,6 +325,30 @@
<c:path>$user/name</c:path>
</target>
</inbound>
<inbound id="24">
<strength>strong</strength>
<expression>
<assignmentTargetSearch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:AssignmentTargetSearchExpressionEvaluatorType">
<targetType>RoleType</targetType>
<oid>c89f31dd-8d4f-4e0a-82cb-58ff9d8c1b2f</oid>
<assignmentProperties xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:AssignmentPropertiesSpecificationType">
<subtype>grouper-basic</subtype>
</assignmentProperties>
</assignmentTargetSearch>
</expression>
<target>
<c:path>assignment</c:path>
<set>
<condition>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
assignment.subtype.contains('grouper-basic')
</code>
</script>
</condition>
</set>
</target>
</inbound>
</attribute>
<attribute id="7">
<c:ref>ri:givenName</c:ref>
Expand All @@ -335,13 +359,8 @@
</inbound>
</attribute>
<attribute id="8">
<c:ref>ri:fullname</c:ref>
<c:ref>ri:fullName</c:ref>
<inbound id="16">
<expression>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ScriptExpressionEvaluatorType">
<code>focus?.getGivenName() + ' ' + focus?.getFamilyName()</code>
</script>
</expression>
<target>
<c:path>$user/fullName</c:path>
</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,14 @@ public Schema schema() {
familyName.setRequired(false);
familyName.setMultiValued(false);
attributes.add(familyName.build());
AttributeInfoBuilder fullname = new AttributeInfoBuilder();
fullname.setName("fullname");
fullname.setCreateable(true);
fullname.setUpdateable(true);
fullname.setReadable(true);
fullname.setRequired(false);
fullname.setMultiValued(false);
attributes.add(fullname.build());
AttributeInfoBuilder fullName = new AttributeInfoBuilder();
fullName.setName("fullName");
fullName.setCreateable(true);
fullName.setUpdateable(true);
fullName.setReadable(true);
fullName.setRequired(false);
fullName.setMultiValued(false);
attributes.add(fullName.build());
AttributeInfoBuilder firstname = new AttributeInfoBuilder();
firstname.setName("firstname");
firstname.setCreateable(true);
Expand Down Expand Up @@ -360,6 +360,13 @@ public void executeQuery(ObjectClass oc, AmqpFilter filter, ResultsHandler handl
LOG.info(familyName);
builder.addAttribute("familyName", familyName);
}
if ( name.containsKey("familyName") && name.containsKey("givenName") ) {
String familyName = (String) name.get("familyName");
String givenName = (String) name.get("givenName");
String fullName = givenName + ' ' + familyName;
LOG.info(fullName);
builder.addAttribute("fullName", fullName);
}
if ( name.containsKey("nameType") ) {
String nameType = (String) name.get("nameType");
LOG.info(nameType);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package edu.unc.polygon.connector.amqp;

import org.identityconnectors.framework.common.objects.Attribute;
import org.identityconnectors.framework.common.objects.Uid;
import org.identityconnectors.framework.common.objects.filter.AbstractFilterTranslator;
import org.identityconnectors.framework.common.objects.filter.EqualsFilter;

import java.util.List;

public class AmqpFilterTranslator extends AbstractFilterTranslator<String> {

@Override
protected String createEqualsExpression(EqualsFilter filter, boolean not) {
if (not) {
return null;
}

Attribute attr = filter.getAttribute();
if (!attr.is(Uid.NAME)) {
return null;
}

List<Object> values = attr.getValue();
if (values.isEmpty()) {
return null;
}

Object value = values.get(0);

return value != null ? value.toString() : null;
}
}

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
UI_AMQP_CONNECTOR_NAME=AMQP Connector
UI_AMQP_USERNAME=AMQP Username
UI_AMQP_USERNAME_HELP=The Username to authenticate to the rabbitMQ virtualhost.
UI_AMQP_PASSWORD=AMQP Password
UI_AMQP_PASSWORD_HELP=Password for the rabbitMQ virtualhost connection.
UI_AMQP_HOST=AMQP Host
UI_AMQP_HOST_HELP=Hostname or IP of the server running rabbitMQ.
UI_AMQP_EXCHANGE_NAME=AMQP Exchange Name
UI_AMQP_EXCHANGE_NAME_HELP=The exchange or topic on the rabbitMQ virtualhost.
UI_AMQP_QUEUE_NAME=AMQP Queue Name
UI_AMQP_QUEUE_NAME_HELP=The queue on the rabbitMQ exchange.
UI_AMQP_ROUTING_KEY=AMQP Routing Key
UI_AMQP_ROUTING_KEY_HELP=The routing key for messages on the queue to process to import accounts.
UI_AMQP_UNIQUE_ATTRIBUTE=AMQP Unique Attribute
UI_AMQP_UNIQUE_ATTRIBUTE_HELP=The unique attribute for accounts on the source system or messages (id, externalId,userName etc.), may be the same as the name attribute.
UI_AMQP_NAME_ATTRIBUTE=AMQP Name Attribute
UI_AMQP_NAME_ATTRIBUTE_HELP=The name attribure for accounts in the source system or messages.
UI_AMQP_PASSWORD_ATTRIBUTE=AMQP Password Attribute
UI_AMQP_PASSWORD_ATTRIBUTE_HELP=The password attribute for the account from the source system or messages.
UI_AMQP_SCIM_PAYLOAD_FIELD=Scim Payload Field
UI_AMQP_SCIM_PAYLOAD_FIELD_HELP=The field inside the AMQP message that holds the SCIM payload.
Binary file not shown.
5 changes: 5 additions & 0 deletions connector-amqp-import/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Generated by Maven
#Mon Nov 11 12:18:35 EST 2019
version=0.4-SNAPSHOT
groupId=edu.unc.polygon
artifactId=connector-amqp-import
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
edu/unc/polygon/connector/amqp/AmqpFilterTranslator.class
edu/unc/polygon/connector/amqp/AmqpFilter.class
edu/unc/polygon/connector/amqp/AmqpConfiguration.class
edu/unc/polygon/connector/amqp/AmqpConnector.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/home/ekromhout/src/midpoint-connectors/connector-amqp-import/src/main/java/edu/unc/polygon/connector/amqp/AmqpConnector.java
/home/ekromhout/src/midpoint-connectors/connector-amqp-import/src/main/java/edu/unc/polygon/connector/amqp/AmqpConfiguration.java
/home/ekromhout/src/midpoint-connectors/connector-amqp-import/src/main/java/edu/unc/polygon/connector/amqp/AmqpFilterTranslator.java
/home/ekromhout/src/midpoint-connectors/connector-amqp-import/src/main/java/edu/unc/polygon/connector/amqp/AmqpFilter.java

0 comments on commit 38bc87c

Please sign in to comment.