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 860b0d3 commit d10aeeb
Show file tree
Hide file tree
Showing 16 changed files with 1,175 additions and 0 deletions.
94 changes: 94 additions & 0 deletions connector-scim2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>connector-parent</artifactId>
<groupId>com.evolveum.polygon</groupId>
<version>1.5.0.0</version>
</parent>

<groupId>edu.unc.polygon</groupId>
<artifactId>connector-scim2</artifactId>
<version>.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Scim2 Connector</name>

<properties>
<connectorPackage>edu.unc.polygon.connector.scim2</connectorPackage>
<connectorClass>Scim2Connector</connectorClass>
</properties>

<repositories>
<repository>
<id>evolveum-nexus-releases</id>
<name>Internal Releases</name>
<url>http://nexus.evolveum.com/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>evolveum-nexus-snapshots</id>
<name>Internal Releases</name>
<url>http://nexus.evolveum.com/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>apache-snapshots</id>
<name>Apache Snapshots</name>
<url>http://repository.apache.org/snapshots/</url>
</repository>
</repositories>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<artifactId>connector-rest</artifactId>
<groupId>com.evolveum.polygon</groupId>
<version>1.4.2.14-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>


</dependencies>

</project>
284 changes: 284 additions & 0 deletions connector-scim2/samples/improv.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
<resource 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="e8cf6519-2d14-4239-a1c7-36865b0e62b6" version="24">
<name>improv</name>
<metadata>
<modifyTimestamp>2020-02-06T15:29:09.728Z</modifyTimestamp>
<modifierRef oid="00000000-0000-0000-0000-000000000002" relation="org:default" type="c:UserType">
<!-- administrator -->
</modifierRef>
<modifyChannel>http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user</modifyChannel>
</metadata>
<iteration>0</iteration>
<iterationToken/>
<operationalState>
<lastAvailabilityStatus>up</lastAvailabilityStatus>
</operationalState>
<connectorRef oid="d004381c-a5d3-416f-b64d-52f3e279854c" relation="org:default" type="c:ConnectorType">
<!-- ConnId edu.unc.polygon.connector.scim2.Scim2Connector v.1-SNAPSHOT -->
</connectorRef>
<connectorConfiguration xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:ConnectorConfigurationType">
<icfc:configurationProperties xmlns:gen889="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/edu.unc.polygon.connector-scim2/edu.unc.polygon.connector.scim2.Scim2Connector" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="icfc:ConfigurationPropertiesType">
<gen889:scim2Filter>username+sw+%22kromhout%22</gen889:scim2Filter>
<gen889:serviceAddress>https://improvapidev.itsapps.unc.edu</gen889:serviceAddress>
<gen889:password>
<t:encryptedData>
<t:encryptionMethod>
<t:algorithm>http://www.w3.org/2001/04/xmlenc#aes256-cbc</t:algorithm>
</t:encryptionMethod>
<t:keyInfo>
<t:keyName>asn37wSv5ncINVV2s1DWJ1L2OZw=</t:keyName>
</t:keyInfo>
<t:cipherData>
<t:cipherValue>ioFdIyvE0D7n8QBBS8Zh8VFmrxh1iZoD70OHEN1+MgnHfo4it6+wTYWsJ8PfPgrh</t:cipherValue>
</t:cipherData>
</t:encryptedData>
</gen889:password>
<gen889:username>kromhout</gen889:username>
<gen889:scim2Attributes>id,active,username,externalId</gen889:scim2Attributes>
</icfc:configurationProperties>
</connectorConfiguration>
<schema>
<cachingMetadata>
<retrievalTimestamp>2020-02-05T19:09:25.301Z</retrievalTimestamp>
<serialNumber>e73c55a3cf739291-2b25ec7393242e89</serialNumber>
</cachingMetadata>
<definition>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3" xmlns:ra="http://midpoint.evolveum.com/xml/ns/public/resource/annotation-3" xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" elementFormDefault="qualified" targetNamespace="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">
<xsd:import namespace="http://prism.evolveum.com/xml/ns/public/annotation-3"/>
<xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"/>
<xsd:import namespace="http://midpoint.evolveum.com/xml/ns/public/resource/annotation-3"/>
<xsd:complexType name="AccountObjectClass">
<xsd:annotation>
<xsd:appinfo>
<ra:resourceObject/>
<ra:identifier>icfs:uid</ra:identifier>
<ra:secondaryIdentifier>icfs:name</ra:secondaryIdentifier>
<ra:displayNameAttribute>icfs:name</ra:displayNameAttribute>
<ra:namingAttribute>icfs:name</ra:namingAttribute>
<ra:nativeObjectClass>__ACCOUNT__</ra:nativeObjectClass>
<ra:kind>account</ra:kind>
<ra:default>true</ra:default>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" name="active" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>120</a:displayOrder>
<ra:frameworkAttributeName>active</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="userName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>130</a:displayOrder>
<ra:frameworkAttributeName>userName</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element ref="icfs:name">
<xsd:annotation>
<xsd:appinfo>
<a:displayName>ConnId Name</a:displayName>
<a:displayOrder>110</a:displayOrder>
<ra:frameworkAttributeName>__NAME__</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="id" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>140</a:displayOrder>
<ra:frameworkAttributeName>id</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" name="externalId" type="xsd:string">
<xsd:annotation>
<xsd:appinfo>
<a:displayOrder>150</a:displayOrder>
<ra:frameworkAttributeName>externalId</ra:frameworkAttributeName>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element minOccurs="0" ref="icfs:uid">
<xsd:annotation>
<xsd:appinfo>
<a:displayName>ConnId UID</a:displayName>
<a:displayOrder>100</a:displayOrder>
<a:access>read</a:access>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</definition>
</schema>
<schemaHandling>
<objectType id="7">
<kind>account</kind>
<intent>default</intent>
<default>true</default>
<objectClass>AccountObjectClass</objectClass>
<attribute id="1">
<c:ref xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">icfs:uid</c:ref>
<inbound id="9">
<target>
<c:path>$user/name</c:path>
</target>
</inbound>
<outbound>
<source>
<c:path>$user/name</c:path>
</source>
</outbound>

</attribute>
<attribute id="10">
<c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:externalId</c:ref>
<inbound id="13">
<target>
<c:path xmlns:uncPerson="http://unc.edu/xml/ns/uncPerson">$user/extension/uncPerson:subId</c:path>
</target>
</inbound>
<source>
<c:path xmlns:uncPerson="http://unc.edu/xml/ns/uncPerson">$user/extension/uncPerson:subId</c:path>
</source>
</outbound>

</attribute>
<attribute id="11">
<c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:active</c:ref>
<inbound id="14">
<target>
<c:path xmlns:uncPerson="http://unc.edu/xml/ns/uncPerson">$user/extension/uncPerson:isActive</c:path>
</target>
</inbound>
</attribute>
<attribute id="12">
<c:ref xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">ri:userName</c:ref>
<inbound id="15">
<target>
<c:path xmlns:uncPerson="http://unc.edu/xml/ns/uncPerson">$user/extension/uncPerson:logonId</c:path>
</target>
</inbound>
<outbound>
<source>
<c:path xmlns:uncPerson="http://unc.edu/xml/ns/uncPerson">$user/extension/uncPerson:logonId</c:path>
</source>
</outbound>

</attribute>
</objectType>
</schemaHandling>
<capabilities>
<cachingMetadata>
<retrievalTimestamp>2020-02-05T19:09:25.291Z</retrievalTimestamp>
<serialNumber>eaa11c2945c3b022-9f2d263021027cc7</serialNumber>
</cachingMetadata>
<native xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:CapabilityCollectionType">
<cap:schema/>
<cap:testConnection/>
<cap:script>
<cap:host>
<cap:type>connector</cap:type>
</cap:host>
</cap:script>
<cap:activation>
<cap:status/>
</cap:activation>
<cap:read>
<cap:returnDefaultAttributesOption>false</cap:returnDefaultAttributesOption>
</cap:read>
</native>
<configured xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xsi:type="c:CapabilityCollectionType">
<cap:testConnection>
<cap:enabled>true</cap:enabled>
</cap:testConnection>
<cap:script>
<cap:enabled>true</cap:enabled>
<cap:host>
<cap:type>connector</cap:type>
</cap:host>
</cap:script>
<cap:activation>
<cap:enabled>true</cap:enabled>
<cap:status>
<cap:enabled>true</cap:enabled>
<cap:returnedByDefault>true</cap:returnedByDefault>
<cap:ignoreAttribute>true</cap:ignoreAttribute>
</cap:status>
<cap:validFrom>
<cap:enabled>false</cap:enabled>
<cap:returnedByDefault>false</cap:returnedByDefault>
</cap:validFrom>
<cap:validTo>
<cap:enabled>false</cap:enabled>
<cap:returnedByDefault>false</cap:returnedByDefault>
</cap:validTo>
<cap:lockoutStatus>
<cap:enabled>false</cap:enabled>
<cap:returnedByDefault>false</cap:returnedByDefault>
<cap:ignoreAttribute>true</cap:ignoreAttribute>
</cap:lockoutStatus>
</cap:activation>
<cap:read>
<cap:enabled>true</cap:enabled>
<cap:returnDefaultAttributesOption>false</cap:returnDefaultAttributesOption>
</cap:read>
</configured>
</capabilities>
<synchronization>
<objectSynchronization>
<name>Account sync policy</name>
<objectClass>AccountObjectClass</objectClass>
<kind>account</kind>
<intent>default</intent>
<focusType>c:UserType</focusType>
<enabled>true</enabled>
<correlation>
<q:equal>
<q:matching>polyStringNorm</q:matching>
<q:path xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3">c:name</q:path>
<expression>
<description>Matches using Name</description>
<path xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"; $account/attributes/icfs:name </path>
</expression>
</q:equal>
</correlation>
<reconcile>false</reconcile>
<reaction>
<situation>linked</situation>
<synchronize>true</synchronize>
</reaction>
<reaction>
<situation>deleted</situation>
<synchronize>true</synchronize>
<action>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#deleteFocus</handlerUri>
</action>
</reaction>
<reaction>
<situation>unlinked</situation>
<synchronize>true</synchronize>
<action>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#link</handlerUri>
</action>
</reaction>
<reaction>
<situation>unmatched</situation>
<synchronize>true</synchronize>
<action>
<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/action-3#addFocus</handlerUri>
</action>
</reaction>
</objectSynchronization>
</synchronization>
</resource>

</objects>
Loading

0 comments on commit d10aeeb

Please sign in to comment.