Skip to content

Commit

Permalink
Initial commit of Grouper To midPoint Docker Container
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan committed Aug 23, 2018
1 parent 741705e commit c3618fe
Show file tree
Hide file tree
Showing 7 changed files with 678 additions and 0 deletions.
13 changes: 13 additions & 0 deletions grouper-to-midpoint-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM centos:latest
MAINTAINER ethan@unc.edu ekromhout@gmail.com
RUN yum -y install epel-release && yum -y update && yum -y install supervisor wget
# Installing Zulu Java
RUN rpm --import http://repos.azulsystems.com/RPM-GPG-KEY-azulsystems \
&& curl -o /etc/yum.repos.d/zulu.repo http://repos.azulsystems.com/rhel/zulu.repo \
&& yum -y install zulu-8

#RUN sed -i s/'nodaemon=false'/'nodaemon=true'/ /etc/supervisord.conf
COPY target/groupermidpoint-0.1-SNAPSHOT-jar-with-dependencies.jar /root/
#CMD ["supervisord","-c","/etc/supervisord.conf"]
#/usr/java/latest/bin/java -cp rabbittrace-0.1-jar-with-dependencies.jar edu.unc.tier.rabbittrace.Trace '#'
CMD ["/usr/java/latest/bin/java","-cp","/root/groupermidpoint-0.1-SNAPSHOT-jar-with-dependencies.jar","edu.unc.tier.groupermidpoint.GrouperToMidpoint"]
43 changes: 43 additions & 0 deletions grouper-to-midpoint-docker/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Grouper to Midpoint Demonstration Container

This is a class to demonstrate the usage of the
Unicon RabbitMQ plugin for Grouper, in conjuction
with midPoint's rest interface. This has a maven
project to build the Java class and a Dockerfile
to build a container to run it.

The below several strings for configuration information
which can be edited in connection.properties
EXCHANGE_NAME
EXCHANGE_HOST
EXCHANGE_USER
EXCHANGE_SECRET
MIDPOINT_REST_URL
MIDPOINT_REST_USER
MIDPOINT_REST_SECRET

There is also two property files that can be used to define
which groups membership additions and deletions should
result in adding or removing roles or resources in midPoint.

roles.properties
resources.properties

ref\:employee = employee

Would add the midPoint employee role to a user when their subjectId was addedd to the ref:employee Grouper group.
It is necessary to escape the colons ":" generally present in Grouper group ids.

This assumes the use of the Grouper Messaging system for RabbitMQ
and the following configuration items:

changeLog.consumer.rabbitMqMessagingSample.publisher.messageQueueType = topic
changeLog.consumer.rabbitMqMessagingSample.publisher.queueOrTopicName = sampleTopic

Other Grouper Messaging configuration items may need to be adjusted
to match your settings in connection.properties.

Example Docker build and run syntax:

docker build .
sudo docker run --network test-compose_back --name groupertomidpoint -d <image id from above>
7 changes: 7 additions & 0 deletions grouper-to-midpoint-docker/connection.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
EXCHANGE_NAME = sampleTopic
EXCHANGE_HOST = rabbitmq
EXCHANGE_USER = user
EXCHANGE_SECRET = guest
MIDPOINT_REST_URL = http://midpoint2.testbed.tier.internet2.edu:18080/ws/rest/
MIDPOINT_REST_USER = administrator
MIDPOINT_REST_SECRET = 5ecr3t
93 changes: 93 additions & 0 deletions grouper-to-midpoint-docker/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2016-2017 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>
<groupId>edu.unc.tier</groupId>
<artifactId>groupermidpoint</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Grouper To Midpoint</name>

<build>
<plugins>
<!-- any other plugins -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.rabbitmq/amqp-client -->
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>4.0.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>

</dependencies>
</project>
2 changes: 2 additions & 0 deletions grouper-to-midpoint-docker/resources.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
app\:drupal_authorized = Drupal

3 changes: 3 additions & 0 deletions grouper-to-midpoint-docker/roles.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ref\:employee = employee
app\:canvas\:users = learner

Loading

0 comments on commit c3618fe

Please sign in to comment.