Skip to content

Commit

Permalink
Do various fixes and improvements
Browse files Browse the repository at this point in the history
1) fixed a couple of scripts by adding #! declaration,
2) temporarily disabled "targets" container - it was not used anyway,
3) added "resolveip fix" to grouper_data Dockerfile (as suggested
on the Slack channel),
4) added 2 new archetypes + added visualization of existing ones
in demo/complex2s,
5) removed "add focus" synchronization in LDAP resource,
6) other minor improvements.

These are done by Ivan Noris.
  • Loading branch information
mederly committed Nov 4, 2019
1 parent 0b7477c commit fc1a4c3
Show file tree
Hide file tree
Showing 25 changed files with 206 additions and 80 deletions.
2 changes: 2 additions & 0 deletions demo/complex/add-ref-groups.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

source ../../library.bash

execute_gsh complex_grouper_daemon_1 add-ref-groups.gsh
Expand Down
17 changes: 9 additions & 8 deletions demo/complex/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ services:
volumes:
- source_data:/var/lib/mysql

targets:
build: ./targets/
ports:
- 23306:389
networks:
- net
volumes:
- target_data:/var/lib/mysql
# temporarily disabled
# targets:
# build: ./targets/
# ports:
# - 23306:389
# networks:
# - net
# volumes:
# - target_data:/var/lib/mysql

midpoint_data:
image: tier/mariadb:mariadb10
Expand Down
2 changes: 2 additions & 0 deletions demo/complex/grouper_data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN yum install -y epel-release \
COPY container_files/seed-data/ /seed-data/
COPY container_files/conf/ /opt/grouper/grouper.apiBinary/conf/

RUN ln -s /usr/bin/resolveip /usr/libexec/resolveip

RUN mysql_install_db \
&& chown -R mysql:mysql /var/lib/mysql/ \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/my.cnf \
Expand Down
2 changes: 2 additions & 0 deletions demo/complex2/add-ref-groups.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

source ../../library.bash

execute_gsh complex2_grouper_daemon_1 add-ref-groups.gsh
2 changes: 2 additions & 0 deletions demo/complex2/create-ref-loaders.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

source ../../library.bash

execute_gsh complex2_grouper_daemon_1 create-ref-loaders.gsh
16 changes: 8 additions & 8 deletions demo/complex2/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ services:
volumes:
- source_data:/var/lib/mysql

targets:
build: ./targets/
ports:
- 23306:389
networks:
- net
volumes:
- target_data:/var/lib/mysql
# targets:
# build: ./targets/
# ports:
# - 23306:389
# networks:
# - net
# volumes:
# - target_data:/var/lib/mysql

midpoint_data:
image: tier/mariadb:mariadb10
Expand Down
2 changes: 2 additions & 0 deletions demo/complex2/grouper_data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN yum install -y epel-release \
COPY container_files/seed-data/ /seed-data/
COPY container_files/conf/ /opt/grouper/grouper.apiBinary/conf/

RUN ln -s /usr/bin/resolveip /usr/libexec/resolveip

RUN mysql_install_db \
&& chown -R mysql:mysql /var/lib/mysql/ \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/my.cnf \
Expand Down
1 change: 1 addition & 0 deletions demo/complex2s/add-ref-groups.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
source ../../library.bash

execute_gsh complex2s_grouper_daemon_1 add-ref-groups.gsh
2 changes: 2 additions & 0 deletions demo/complex2s/create-ref-loaders.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

source ../../library.bash

execute_gsh complex2s_grouper_daemon_1 create-ref-loaders.gsh
16 changes: 8 additions & 8 deletions demo/complex2s/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ services:
volumes:
- source_data:/var/lib/mysql

targets:
build: ./targets/
ports:
- 23306:389
networks:
- net
volumes:
- target_data:/var/lib/mysql
# targets:
# build: ./targets/
# ports:
# - 23306:389
# networks:
# - net
# volumes:
# - target_data:/var/lib/mysql

midpoint_data:
image: tier/mariadb:mariadb10
Expand Down
2 changes: 2 additions & 0 deletions demo/complex2s/grouper_data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ RUN yum install -y epel-release \
COPY container_files/seed-data/ /seed-data/
COPY container_files/conf/ /opt/grouper/grouper.apiBinary/conf/

RUN ln -s /usr/bin/resolveip /usr/libexec/resolveip

RUN mysql_install_db \
&& chown -R mysql:mysql /var/lib/mysql/ \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/my.cnf \
Expand Down
25 changes: 25 additions & 0 deletions demo/complex2s/midpoint-objects/archetypes/academic-person.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype oid="958da09c-fefb-11e9-892d-975972472527"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:org='http://midpoint.evolveum.com/xml/ns/public/common/org-3'>
<name>Academic</name>
<description>Person with a relation to the academy environment</description>
<archetypePolicy>
<display>
<label>Academic</label>
<pluralLabel>Academics</pluralLabel>
<tooltip>Academic person</tooltip>
<icon>
<cssClass>fa fa-user</cssClass>
<color>darkgreen</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<assignmentRelation>
<holderType>UserType</holderType>
</assignmentRelation>
</assignment>
</archetype>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<ext:midPointNamePrefix>affiliation_</ext:midPointNamePrefix>
<ext:midPointDisplayNamePrefix>Affiliation: </ext:midPointDisplayNamePrefix>
</extension>
<archetypePolicy>
<display>
<label>Affiliation</label>
<pluralLabel>Affiliations</pluralLabel>
<icon>
<cssClass>fa fa-superpowers</cssClass>
<color>steelblue</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="bcaec940-50c8-44bb-aa37-b2b5bb2d5b90" relation="org:default" type="c:RoleType" /> <!-- metarole-grouper-provided-group -->
</assignment>
Expand Down
10 changes: 10 additions & 0 deletions demo/complex2s/midpoint-objects/archetypes/archetype-course.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<ext:midPointNamePrefix>course_</ext:midPointNamePrefix>
<ext:midPointDisplayNamePrefix>Course: </ext:midPointDisplayNamePrefix>
</extension>
<archetypePolicy>
<display>
<label>Course</label>
<pluralLabel>Courses</pluralLabel>
<icon>
<cssClass>fa fa-university</cssClass>
<color>teal</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="bcaec940-50c8-44bb-aa37-b2b5bb2d5b90" relation="org:default" type="c:RoleType" /> <!-- metarole-grouper-provided-group -->
</assignment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
<ext:midPointNamePrefix>department_</ext:midPointNamePrefix>
<ext:midPointDisplayNamePrefix>Department: </ext:midPointDisplayNamePrefix>
</extension>
<archetypePolicy>
<display>
<label>Department</label>
<pluralLabel>Departments</pluralLabel>
<icon>
<cssClass>fa fa-building</cssClass>
<color>darkgreen</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="bcaec940-50c8-44bb-aa37-b2b5bb2d5b90" relation="org:default" type="c:RoleType" /> <!-- metarole-grouper-provided-group -->
</assignment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<ext:midPointNamePrefix>generic_</ext:midPointNamePrefix>
<ext:midPointDisplayNamePrefix></ext:midPointDisplayNamePrefix>
</extension>
<archetypePolicy>
<display>
<label>Generic Grouper Group</label>
<pluralLabel>Generic Grouper Groups</pluralLabel>
<icon>
<cssClass>fa fa-users</cssClass>
<color>lightcoral</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="bcaec940-50c8-44bb-aa37-b2b5bb2d5b90" relation="org:default" type="c:RoleType" /> <!-- metarole-grouper-provided-group -->
</assignment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@
<ext:midPointNamePrefix>mailinglist_</ext:midPointNamePrefix>
<ext:midPointDisplayNamePrefix>Mailing list: </ext:midPointDisplayNamePrefix>
</extension>
<archetypePolicy>
<display>
<label>Mailing list</label>
<pluralLabel>Mailing lists</pluralLabel>
<icon>
<cssClass>fa fa-list</cssClass>
<color>darkgoldenrod</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="bcaec940-50c8-44bb-aa37-b2b5bb2d5b90" relation="org:default" type="c:RoleType" /> <!-- metarole-grouper-provided-group -->
</assignment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
<extension>
<ext:ldapRootDn>ou=midpoint,ou=Groups,dc=internet2,dc=edu</ext:ldapRootDn>
</extension>
<archetypePolicy>
<display>
<label>midPoint Group</label>
<pluralLabel>midPoint Groups</pluralLabel>
<icon>
<cssClass>fa fa-users</cssClass>
<color>darkgviolet</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<targetRef oid="8da46694-bd71-4e1e-bfd7-73865ae2ea9a" relation="org:default" type="c:RoleType" /> <!-- metarole-ldap-group -->
</assignment>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype oid="9ea701a0-fefb-11e9-aa4a-6f55fba8896e"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:org='http://midpoint.evolveum.com/xml/ns/public/common/org-3'>
<name>Non-academic</name>
<description>Non-academic person with no relation to the academy environment</description>
<archetypePolicy>
<display>
<label>Non-academic</label>
<pluralLabel>Non-academics</pluralLabel>
<tooltip>Non-academic persons</tooltip>
<icon>
<cssClass>fa fa-space-shuttle</cssClass>
<color>olive</color>
</icon>
</display>
</archetypePolicy>
<assignment>
<assignmentRelation>
<holderType>UserType</holderType>
</assignmentRelation>
</assignment>
</archetype>
10 changes: 3 additions & 7 deletions demo/complex2s/midpoint-objects/resources/ldap-main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<expression>
<path>
declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3";
$account/attributes/ri:uid
$projection/attributes/ri:uid
</path>
</expression>
</q:equal>
Expand All @@ -283,10 +283,6 @@
</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>
<objectSynchronization>
Expand All @@ -300,7 +296,7 @@
<script>
<code>
import javax.naming.ldap.*
dn = new LdapName(basic.getAttributeValue(account, 'http://midpoint.evolveum.com/xml/ns/public/resource/instance-3', 'dn'))
dn = new LdapName(basic.getAttributeValue(projection, 'http://midpoint.evolveum.com/xml/ns/public/resource/instance-3', 'dn'))
dn.startsWith(new LdapName('ou=Affiliations,ou=Groups,dc=internet2,dc=edu')) ||
dn.startsWith(new LdapName('ou=Courses,ou=Groups,dc=internet2,dc=edu')) ||
dn.startsWith(new LdapName('ou=generic,ou=Groups,dc=internet2,dc=edu')) ||
Expand All @@ -312,7 +308,7 @@
<q:equal>
<q:path>extension/ldapDn</q:path>
<expression>
<path>$shadow/attributes/ri:dn</path>
<path>$projection/attributes/ri:dn</path>
</expression>
</q:equal>
</correlation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@
<q:equal>
<q:path>extension/grouperName</q:path>
<expression>
<path>
$account/attributes/name
</path>
<path>$projection/attributes/name</path>
</expression>
</q:equal>
</correlation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@
</condition>
</set>
</target>
</inbound>
<inbound>
<strength>strong</strength>
<expression>
<assignmentTargetSearch>
<targetType>ArchetypeType</targetType>
<oid>958da09c-fefb-11e9-892d-975972472527</oid> <!-- archetype-academic-person -->
<assignmentProperties>
<subtype>grouper-basic</subtype>
</assignmentProperties>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
<set>
<condition>
<script>
<code>
assignment.subtype.contains('grouper-basic')
</code>
</script>
</condition>
</set>
</target>
</inbound>
</attribute>
<attribute>
Expand Down Expand Up @@ -158,7 +182,7 @@
<expression>
<path>
declare namespace ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3";
$account/attributes/ri:uid
$projection/attributes/ri:uid
</path>
</expression>
</q:equal>
Expand Down
Loading

0 comments on commit fc1a4c3

Please sign in to comment.