Skip to content

Commit 2ba8ba7

Browse files
committed
Release 3.1.8
- Updated Spring-boot-parent. - Changed elixirBonaFideStatus calculation. - Fixed setting "from" in MimeMessage in Peruns notifications. - Added method to get list of resource attributes by their names. - Fixed escaping values in XML in MU password manager. - Escape HTML in users name in GUI. - Added alternativeLoginName UES attribute (stored by default). - Removed duplicit call of attribute value check for member-resource attributes. - Fixed auditer message "Group was moved.". - Fixed regexes in patterns in LDAPc, we use DOTALL instead of MULTILINE modifier. It caused LDAPc to be stuck in resolving group messages on "Group was moved." even if it wasn't this kind of message.
2 parents ba78b76 + 443c9dc commit 2ba8ba7

File tree

38 files changed

+692
-91
lines changed

38 files changed

+692
-91
lines changed

perun-auditer-exporter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>perun</artifactId>
88
<groupId>cz.metacentrum</groupId>
9-
<version>3.1.7</version>
9+
<version>3.1.8</version>
1010
</parent>
1111

1212
<groupId>cz.metacentrum.perun</groupId>

perun-auditparser/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>perun</artifactId>
88
<groupId>cz.metacentrum</groupId>
9-
<version>3.1.7</version>
9+
<version>3.1.8</version>
1010
</parent>
1111

1212
<groupId>cz.metacentrum.perun</groupId>

perun-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>perun</artifactId>
88
<groupId>cz.metacentrum</groupId>
9-
<version>3.1.7</version>
9+
<version>3.1.8</version>
1010
</parent>
1111

1212
<groupId>cz.metacentrum.perun</groupId>

perun-base/src/main/java/cz/metacentrum/perun/core/api/CoreConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ private void createAttributeDefinitions(String extSourceType, List<String> attrN
431431
attr.setDisplayName("schacHomeOrganization");
432432
attr.setDescription("domain name of person's organization (SChema for Academia)");
433433
break;
434+
case "alternativeLoginName":
435+
attr.setDisplayName("alternativeLoginName");
436+
attr.setDescription("person's alternative login name in organization (not related to IdP identity).");
437+
// forwardedScopedAffiliation - is not standardized and published by the proxy itself, we do not
438+
// set it back to the Perun (UES attribute), but we can read it (for registrar purpose).
434439
case "dn":
435440
attr.setDisplayName("certificate DN");
436441
attr.setDescription("Distinguished Name from X509 digital certificate");

perun-base/src/main/resources/perun-base.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<prop key="perun.DBInitializatorEnabled">false</prop>
9797
<prop key="perun.userExtSources.persistent">PERUN,[\w\d]*</prop>
9898
<prop key="perun.proxyIdPs"/>
99-
<prop key="perun.attributesForUpdate.idp">mail,cn,sn,givenName,o,ou,eppn,affiliation,displayName,uid,epuid,schacHomeOrganization,forwardedScopedAffiliation</prop>
99+
<prop key="perun.attributesForUpdate.idp">mail,cn,sn,givenName,o,ou,eppn,affiliation,displayName,uid,epuid,schacHomeOrganization,forwardedScopedAffiliation,alternativeLoginName</prop>
100100
<prop key="perun.attributesForUpdate.x509">mail,cn,o,dn,cadn,certificate</prop>
101101
<prop key="perun.instanceId">AOJ26J3D9DCK3OA7</prop>
102102
<prop key="perun.instanceName">LOCAL</prop>

perun-cabinet/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>perun</artifactId>
88
<groupId>cz.metacentrum</groupId>
9-
<version>3.1.7</version>
9+
<version>3.1.8</version>
1010
</parent>
1111

1212
<groupId>cz.metacentrum.perun</groupId>

perun-core/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>perun</artifactId>
88
<groupId>cz.metacentrum</groupId>
9-
<version>3.1.7</version>
9+
<version>3.1.8</version>
1010
</parent>
1111

1212
<groupId>cz.metacentrum.perun</groupId>
@@ -202,6 +202,11 @@
202202
<artifactId>opencsv</artifactId>
203203
</dependency>
204204

205+
<dependency>
206+
<groupId>org.apache.commons</groupId>
207+
<artifactId>commons-text</artifactId>
208+
</dependency>
209+
205210
<dependency>
206211
<groupId>com.google.apis</groupId>
207212
<artifactId>google-api-services-admin-directory</artifactId>

perun-core/src/main/java/cz/metacentrum/perun/core/api/AttributesManager.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,22 @@ public interface AttributesManager {
440440
*/
441441
List<Attribute> getAttributes(PerunSession sess, Group group, List<String> attrNames) throws PrivilegeException, InternalErrorException, GroupNotExistsException;
442442

443+
/**
444+
* Get all attributes associated with the resource which have name in list attrNames (empty too).
445+
* Virtual attribute too.
446+
* <p>
447+
* PRIVILEGE: Get only those attributes the principal has access to.
448+
*
449+
* @param sess perun session
450+
* @param resource to get the attributes from
451+
* @param attrNames list of attributes' names
452+
* @return list of attributes
453+
* @throws PrivilegeException if privileges are not given
454+
* @throws InternalErrorException if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
455+
* @throws ResourceNotExistsException if the resource not exists in Perun
456+
*/
457+
List<Attribute> getAttributes(PerunSession sess, Resource resource, List<String> attrNames) throws PrivilegeException, InternalErrorException, ResourceNotExistsException;
458+
443459
/**
444460
* Get all attributes associated with the member which have name in list attrNames (empty too)
445461
* Virtual attributes too.

perun-core/src/main/java/cz/metacentrum/perun/core/bl/AttributesManagerBl.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,19 @@ public interface AttributesManagerBl {
352352
*/
353353
List<Attribute> getAttributes(PerunSession sess, Group group, List<String> attrNames) throws InternalErrorException;
354354

355+
/**
356+
* Get all attributes associated with the resource which have name in list attrNames (empty too).
357+
* Virtual attribute too.
358+
*
359+
* @param sess perun session
360+
* @param resource to get the attributes from
361+
* @param attrNames list of attributes' names
362+
* @return list of attributes
363+
*
364+
* @throws InternalErrorException if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException
365+
*/
366+
List<Attribute> getAttributes(PerunSession sess, Resource resource, List<String> attrNames) throws InternalErrorException;
367+
355368
/**
356369
* Get all attributes associated with the vo which have name in list attrNames (empty and virtual too).
357370
*

perun-core/src/main/java/cz/metacentrum/perun/core/blImpl/AttributesManagerBlImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,13 @@ public List<Attribute> getAttributes(PerunSession sess, Group group, List<String
363363
return getAttributesManagerImpl().getAttributes(sess, group, attrNames);
364364
}
365365

366+
@Override
367+
public List<Attribute> getAttributes(PerunSession sess, Resource resource, List<String> attrNames) throws InternalErrorException {
368+
if (attrNames.isEmpty()) return new ArrayList<>();
369+
return getAttributesManagerImpl().getAttributes(sess, resource, attrNames);
370+
}
371+
372+
@Override
366373
public List<Attribute> getAttributes(PerunSession sess, Member member, List<String> attrNames, boolean workWithUserAttributes) throws InternalErrorException {
367374
List<Attribute> attributes = this.getAttributes(sess, member, attrNames);
368375

@@ -3832,7 +3839,6 @@ public void removeAllAttributes(PerunSession sess, Resource resource, Member mem
38323839
for (Attribute attribute : attributes) attribute.setValue(null);
38333840
try {
38343841
checkAttributesValue(sess, resource, member, attributes);
3835-
checkAttributesValue(sess, resource, member, attributes);
38363842
} catch (WrongAttributeAssignmentException ex) {
38373843
throw new ConsistencyErrorException(ex);
38383844
}

0 commit comments

Comments
 (0)