Skip to content

Commit

Permalink
Update README.md and add artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
sfox committed Nov 19, 2021
1 parent 95c76b3 commit 2812ab4
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,26 +491,32 @@ As discussed in the section on connector configuration you can extend the stem s
</table>


As discussed in the section on connector configuration you can extend the group schema by adding attribute assignment names. When the group has the assigned attribute name contained in the attributesJSON field it will be broken out into its own attribute.
As discussed in the section on connector configuration you can extend the group schema by adding attribute assignment names.
When the group has the assigned attribute name contained in the attributesJSON field it will be broken out into its own attribute.


# 8 Grouper Messages
# 8 Grouper Messages For Async Updates

The grouper system has the capability to send messages that can notify the IAM system of changes to an object's state. With Midpoint you can implement [Asynchronous Processing](https://docs.evolveum.com/midpoint/devel/design/on-asynchronous-processing/) alongside the grouper connector.

The Grouper System can provide the following event messages:
The grouper system is capabile of sending messages that can notify the IAM system of changes to an object's state.
With Midpoint you can implement the [Asynchronous Update Connector](https://docs.evolveum.com/connectors/connectors/builtin/AsyncUpdateConnector/)
as an additional connector in your Grouper Connector Resource Configuration. We have included a fragment in the **artifacts** folder
that you can include in Grouper Connector Resource configuration to implement asynchronous updates.

The fragment calls a [Function Library](https://docs.evolveum.com/midpoint/reference/expressions/function-libraries/configuration/)
to process messages. The **artifacts** folder in this repository contains a function library you can use to process Grouper STEM messages

The Grouper System can provide the following event messages:

* ATTRIBUTE_ASSIGN_ADD
* ATTRIBUTE_ASSIGN_DELETE
* ATTRIBUTE_ASSIGN_UPDATE,
* ATTRIBUTE_ASSIGN_VALUE_ADD
* ATTRIBUTE_ASSIGN_VALUE_DELETE
* STEM_ADD
* STEM_DELETE
* STEM_UPDATE
* GROUP_ADD
* GROUP_UPDATE
* GROUP_DELETE,
* GROUP_DELETE
* MEMBERSHIP_ADD
* MEMBERSHIP_UPDATE
* MEMBERSHIP_DELETE
53 changes: 53 additions & 0 deletions artifacts/archetypes/grouperToSympaIntegrationArchetype.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<archetype xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
oid="<Enter a New OID>"
version="2">
<!--
This archetype is creates 2 inducements that allow a Grouper STEM to
1. Be assigned to a base Midpoint organization
2. Create a Sympa List
The archetype oid is typically referenced in a resource configuration Schema Handling inbound assignment
-->
<name>Grouper To SYMPA integration Archetype</name>
<iteration>0</iteration>
<iterationToken/>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2021-09-10T22:06:48.815Z</enableTimestamp>
</activation>
<displayName>Sympa Email List Archetype for Internet2 Domain</displayName>
<inducement id="2">
<targetRef oid="<Base ORG OID>" relation="org:default" type="c:OrgType">
<!-- The base ORG OID is the OID of a midpoint organization you create to hold Children of your
Grouper Base Stem
-->
</targetRef>
</inducement>
<inducement id="3">
<construction>
<resourceRef oid="<Sympa Connector Resource OID>" relation="org:default" type="c:ResourceType">
<!--
Enter the Resource OID of the Sympa connector instance that corresponds to SYMPA server
than will handle LIST creation for the Grouper Base Stem.
-->
</resourceRef>
<kind>account</kind>
<intent>default</intent>
</construction>
</inducement>
<archetypePolicy>
<display>
<label>Mailing list</label>
<pluralLabel>Mailing lists</pluralLabel>
<icon>
<cssClass>fa fa-list</cssClass>
<color>blue</color>
</icon>
</display>
</archetypePolicy>
</archetype>
73 changes: 73 additions & 0 deletions artifacts/functionLibraries/grouperStems.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<functionLibrary xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
oid="04602441-dff7-4eb1-a8cb-834c7733633a"
version="0">
<!--
The grouperStems function library is intended to handle STEM messages sent from grouper. To take advantage
of the asynchronous updates the midpoint Built in Async Update Connector must configured in the Grouper Resource
You will be using.
-->
<name>grouperStems</name>
<description>Functions for Grouper AMQP connector to Manage Sympa List Manager</description>
<iteration>0</iteration>
<iterationToken/>
<function>
<name>handleMessage</name>
<parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ExpressionParameterType">
<name>message</name>
<type>c:AsyncUpdateMessageType</type>
</parameter>
<returnType>c:UcfChangeType</returnType>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
import com.evolveum.midpoint.xml.ns._public.common.common_3.*
import com.evolveum.prism.xml.ns._public.types_3.*
import static com.evolveum.midpoint.schema.constants.SchemaConstants.*
import com.evolveum.midpoint.schema.util.*
import com.evolveum.midpoint.prism.path.*
import com.evolveum.midpoint.schema.constants.*
import com.evolveum.midpoint.prism.delta.*
STEM_OBJECT_CLASS = new ItemName(MidPointConstants.NS_RI, 'Stem')
ATTR_NAME = new ItemName(MidPointConstants.NS_RI, 'name')
ATTR_UUID = new ItemName(MidPointConstants.NS_RI, 'uuid')

esbEvent = midpoint.getMessageBodyAsMap(message)['esbEvent'][0];
log.info( 'SYMPA Event {}', esbEvent)
eventType = esbEvent['eventType'];
if ( eventType == 'STEM_UPDATE')
{
stemName = esbEvent['name'];
stemId = esbEvent['id'];
parentStemId = esbEvent[''];
identifiers = new HashMap();
identifiers.put(ATTR_NAME, stemName);
identifiers.put(ATTR_UUID, stemId);
log.info( 'STEM_UPDATE on {}', stemName);
return UcfChangeUtil.create(STEM_OBJECT_CLASS, identifiers, null, prismContext);
}
else if ( eventType == 'STEM_DELETE' )
{
stemName = esbEvent['name'];
stemId = esbEvent['id'];
parentStemId = esbEvent[''];
identifiers = new HashMap()
identifiers.put(ATTR_NAME, stemName);
identifiers.put(ATTR_UUID, stemId);
ObjectDeltaType delta = new ObjectDeltaType();
delta.changeType = ChangeTypeType.DELETE;
log.info( 'STEM_DELETE {}', stemName);
return UcfChangeUtil.create(STEM_OBJECT_CLASS, identifiers, delta, prismContext)
}
else
{
return null;
}
</code>
</script>
</function>
</functionLibrary>
42 changes: 42 additions & 0 deletions artifacts/resources/async_update_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
This Resource Configuration fragment is placed immediately after the <connectorConfiguration> element
-->
<additionalConnector id="1">
<name>AMQP async update connector</name>
<connectorRef oid="<Enter Built In Connector OID>" relation="org:default" type="c:ConnectorType">
<filter>
<q:equal>
<q:path>connectorType</q:path>
<q:value>AsyncUpdateConnector</q:value>
</q:equal>
</filter>
</connectorRef>
<connectorConfiguration xmlns:gen871="http://midpoint.evolveum.com/xml/ns/public/connector/builtin-1/bundle/com.evolveum.midpoint.provisioning.ucf.impl.builtin.async/AsyncUpdateConnector">
<gen871:sources>
<amqp091>
<uri>amqp://mq:1234</uri>
<username>aUserName</username>
<password>aPassword</password>
<queue>AQueueName</queue>
</amqp091>
</gen871:sources>
<gen871:transformExpression>
<script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="c:ScriptExpressionEvaluatorType">
<code>
<!-- Calls a Function Library named "grouperStems" with a method named "handleMessage"
Function libraries take as input a hashmap containing the named parameters required by the method
In this example the Hashmap only contains 1 parameter named message.
The async update connector provides a variable named message
-->
parameters = ['message': message]
grouperStems.execute('handleMessage', parameters)
</code>
</script>
</gen871:transformExpression>
</connectorConfiguration>
<capabilities>
<native xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
<cap:asyncUpdate/>
</native>
</capabilities>
</additionalConnector>
58 changes: 58 additions & 0 deletions artifacts/schema/sympa_org_extension.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<xsd:schema elementFormDefault="qualified"
targetNamespace="http://sympa.internet2.edu"
xmlns:tns="http://aHost.internet2.edu"
xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- Extended fields for a midpoint OrgType to support SYMPA Mailing List Server attributes
Place this file in your MIDPOINT_HOME/schema directory and restart your midpoint server
-->
<xsd:complexType name="OrgExtensionType">
<xsd:annotation>
<xsd:appinfo>
<a:extension ref="c:OrgType"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="subject" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>Subject</a:displayName>
<a:help>Typically used as a mailing list subject</a:help>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="template" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>Template</a:displayName>
<a:help>Typically used as a mailing list template for construction</a:help>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="topic" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>Topics</a:displayName>
<a:help>Typically used to describes the topics covered by the item</a:help>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="homepage" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>Home Page</a:displayName>
<a:help>The URL location of the Homepage</a:help>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

Loading

0 comments on commit 2812ab4

Please sign in to comment.