Skip to content
Permalink
Browse files

Merge branch 'stem-less' of https://github.internet2.edu/docker/midPo…

…int_container into stem-less
  • Loading branch information
mederly committed Mar 26, 2019
2 parents 053a5ec + 20d5b22 commit a384fd4bf5e1648de7121a1e089740d11b124c08
@@ -73,8 +73,12 @@
<type>xsd:string</type>
</parameter>
<parameter>
<name>exportedGroupPrefix</name>
<type>xsd:string</type>
<name>groupIncludePattern</name>
<type>xsd:anyType</type>
</parameter>
<parameter>
<name>groupExcludePattern</name>
<type>xsd:anyType</type>
</parameter>
<parameter>
<name>relevantSourceId</name>
@@ -97,7 +101,7 @@
log.warn('No group name in membership change message, ignoring it: {}', esbEvent)
return null
}
isExported = groupName.startsWith(exportedGroupPrefix)
isExported = matches(groupName, groupIncludePattern, groupExcludePattern)
isSuper = groupName == superGroup
if (!isExported &amp;&amp; !isSuper) {
log.info('Irrelevant group membership change, ignoring it: {}', groupName)
@@ -129,7 +133,7 @@
} else if (eventType == 'GROUP_ADD' || eventType == 'GROUP_DELETE') {
groupName = esbEvent['name']
groupId = esbEvent['id']
isExported = groupName.startsWith(exportedGroupPrefix)
isExported = matches(groupName, groupIncludePattern, groupExcludePattern)
if (!isExported) {
log.info('Irrelevant group add/delete event, ignoring it: {}', groupName)
return null
@@ -149,6 +153,23 @@
log.warn('Unsupported event type: {} -> {}', eventType, esbEvent)
return null
}

def matches(String name, Collection includes, Collection excludes) {
matches(name, includes) &amp;&amp; !matches(name, excludes)
}

def matches(String name, Collection patterns) {
if (name == null || patterns == null) {
false
} else {
for (pattern in patterns) {
if (name ==~ pattern) {
return true
}
}
false
}
}
</code>
</script>
<returnType>c:UcfChangeType</returnType>
@@ -42,8 +42,11 @@
<rest:username>banderson</rest:username>
<rest:password>password</rest:password>
<rest:superGroup>etc:midpointGroups</rest:superGroup>
<rest:rootStem>midpoint</rest:rootStem>
<rest:groupIncludePattern>midpoint:.*</rest:groupIncludePattern>
<rest:groupIncludePattern>ref:.*</rest:groupIncludePattern>
<rest:groupExcludePattern>ref:.*_(includes|excludes|systemOfRecord|systemOfRecordAndIncludes)</rest:groupExcludePattern>
<rest:subjectSource>ldap</rest:subjectSource>
<rest:groupSource>g:gsa</rest:groupSource>
<rest:ignoreSslValidation>true</rest:ignoreSslValidation>
</icfc:configurationProperties>
</connectorConfiguration>
@@ -72,9 +75,10 @@
// ------------------ START OF CONFIGURATION ------------------

parameters = [
superGroup: 'etc:midpointGroups',
exportedGroupPrefix: 'midpoint:',
relevantSourceId: 'ldap'
superGroup: 'etc:midpointGroups',
groupIncludePattern: [ 'midpoint:.*', 'ref:.*' ],
groupExcludePattern: [ 'ref:.*_(includes|excludes|systemOfRecord|systemOfRecordAndIncludes)' ],
relevantSourceId: 'ldap'
]

// ------------------ END OF CONFIGURATION ------------------
Binary file not shown.

0 comments on commit a384fd4

Please sign in to comment.
You can’t perform that action at this time.