Skip to content

Commit f73ab48

Browse files
committed
Release 3.1.6
- Less strict version check in CLI (prep. for 3.2.0). - Fixed getFacilitiesByAttribute() for non string values. - Added getAllowedRichGroupsWithAttributes() for Facilities. - Added attribute searcher for resources and members. - Added methods to get resources where user is admin. - Updated attr module for eduPersonScopedAffiliationManuallyAssigned. - LDAPc can handle entities with newlines in properties. - Fixed passing boolean values to CHAR(1) column of Service object.
2 parents ca9fd3f + 3a24a4b commit f73ab48

File tree

61 files changed

+2175
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2175
-113
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.5</version>
9+
<version>3.1.6</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.5</version>
9+
<version>3.1.6</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.5</version>
9+
<version>3.1.6</version>
1010
</parent>
1111

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

perun-base/src/main/java/cz/metacentrum/perun/rpc/deserializer/JsonDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class JsonDeserializer extends Deserializer {
4141
@JsonIgnoreProperties({"name","baseFriendlyName", "friendlyNameParameter", "entity", "beanName"})
4242
private interface AttributeMixIn {}
4343

44-
@JsonIgnoreProperties({"name", "value", "baseFriendlyName", "friendlyNameParameter", "entity", "beanName"})
44+
@JsonIgnoreProperties({"name", "value", "baseFriendlyName", "friendlyNameParameter", "entity", "beanName", "writable"})
4545
private interface AttributeDefinitionMixIn {}
4646

4747
@JsonIgnoreProperties({"commonName", "displayName", "beanName", "specificUser", "majorSpecificType"})

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.5</version>
9+
<version>3.1.6</version>
1010
</parent>
1111

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

perun-cli/Perun/Agent.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package Perun::Agent;
2-
my $agentVersion = '3.0.0';
2+
my $agentVersionMajor = '3';
3+
my $agentVersionMinor = '2';
4+
my $agentVersionPatch = '0';
5+
my $agentVersion = $agentVersionMajor . "." . $agentVersionMinor . "." . $agentVersionPatch;
36

47
use strict;
58
use warnings;
@@ -126,8 +129,8 @@ sub new {
126129
}
127130

128131
# Check the version of the Perun server
129-
if ($response->content !~ /Version: $agentVersion/) {
130-
$response->content =~ m/Version: ([0-9]+.[0-9]+.[0-9]+)/;
132+
if ($response->content !~ /Version: $agentVersionMajor.[0-9]+.[0-9]+/) {
133+
$response->content =~ m/Version: ([0-9]+.[0-9]+.[0-9]+([^ ]*))/;
131134
my $perunVersion = $1;
132135
die Perun::Exception->fromHash( { type => WRONG_AGENT_VERSION, errorInfo =>
133136
"Tools version $agentVersion, Perun version $perunVersion" } );

perun-core/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.5</version>
9+
<version>3.1.6</version>
1010
</parent>
1111

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

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,23 @@ public interface FacilitiesManager {
158158
*/
159159
List<Group> getAllowedGroups(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException;
160160

161+
/**
162+
* Get all RichGroups which can use this facility (Groups must be assigned to Resource which belongs to this facility)
163+
* specificVo and specificService can choose concrete groups
164+
* if specificVo, specificService or both are null, they do not specific (all possible results are returned)
165+
* We also retrieve attributes specified by attrNames for each returned RichGroup.
166+
*
167+
* @param facility searching for this facility
168+
* @param specificVo specific only those results which are in specific VO (with null, all results)
169+
* @param specificService specific only those results, which have resource with assigned specific service (if null, all results)
170+
* @param attrNames with each returned RichGroup we get also attributes specified by this list
171+
* @return list of allowed groups
172+
* @throws FacilityNotExistsException if facility not exist, return this exception
173+
* @throws ServiceNotExistsException if service is not null and not exist
174+
* @throws VoNotExistsException if vo is not null and not exist
175+
*/
176+
List<RichGroup> getAllowedRichGroupsWithAttributes(PerunSession perunSession, Facility facility, Vo specificVo, Service specificService, List<String> attrNames) throws InternalErrorException, PrivilegeException, FacilityNotExistsException, ServiceNotExistsException, VoNotExistsException;
177+
161178
/**
162179
* Return all users who can use this facility
163180
*

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,40 @@ public interface ResourcesManager {
793793
*/
794794
List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, User user) throws InternalErrorException, UserNotExistsException, PrivilegeException;
795795

796+
/**
797+
* Return all resources for the facility and the vo where user is authorized as resource manager.
798+
*
799+
* @param sess
800+
* @param facility the facility to which resources should be assigned to
801+
* @param vo the vo to which resources should be assigned to
802+
* @param authorizedUser user with resource manager role for all those resources
803+
* @return list of defined resources where user has role resource manager
804+
*
805+
* @throws InternalErrorException
806+
* @throws PrivilegeException
807+
* @throws UserNotExistsException
808+
* @throws FacilityNotExistsException
809+
* @throws VoNotExistsException
810+
*/
811+
List<Resource> getResourcesWhereUserIsAdmin(PerunSession sess, Facility facility, Vo vo, User authorizedUser) throws InternalErrorException, PrivilegeException, UserNotExistsException, FacilityNotExistsException, VoNotExistsException;
812+
813+
/**
814+
* Return all resources for the facility and the vo where the group is authorized as resource manager.
815+
*
816+
* @param sess
817+
* @param facility the facility to which resources should be assigned to
818+
* @param vo the vo to which resources should be assigned to
819+
* @param authorizedGroup group with resource manager role for all those resources
820+
* @return list of defined resources where groups has role resource manager
821+
*
822+
* @throws InternalErrorException
823+
* @throws PrivilegeException
824+
* @throws GroupNotExistsException
825+
* @throws FacilityNotExistsException
826+
* @throws VoNotExistsException
827+
*/
828+
List<Resource> getResourcesWhereGroupIsAdmin(PerunSession sess, Facility facility, Vo vo, Group authorizedGroup) throws InternalErrorException, PrivilegeException, GroupNotExistsException, FacilityNotExistsException, VoNotExistsException;
829+
796830
/**
797831
* Gets list of all group administrators of the Resource.
798832
*

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,25 @@ public interface Searcher {
133133
* @throws WrongAttributeAssignmentException wrong attribute assignment
134134
*/
135135
List<Facility> getFacilities(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws PrivilegeException, InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException;
136+
137+
/**
138+
* This method get Map of Attributes with searching values and try to find all resources, which have specific attributes in format.
139+
* Better information about format below. When there are more than 1 attribute in Map, it means all must be true "looking for all of them" (AND)
140+
*
141+
* @param sess perun session
142+
* @param attributesWithSearchingValues map of attributes names
143+
* when attribute is type String, so value is string and we are looking for total match (Partial is not supported now, will be supported later by symbol *)
144+
* when attribute is type Integer, so value is integer in String and we are looking for total match
145+
* when attribute is type List<String>, so value is String and we are looking for at least one total or partial matching element
146+
* when attribute is type Map<String> so value is String in format "key=value" and we are looking total match of both or if is it "key" so we are looking for total match of key
147+
* IMPORTANT: In map there is not allowed char '=' in key. First char '=' is delimiter in MAP item key=value!!!
148+
* @return list of resources that have attributes with specific values (behaviour above)
149+
* if no such resource exists, returns empty list
150+
*
151+
* @throws PrivilegeException insufficient permission
152+
* @throws InternalErrorException internal error
153+
* @throws AttributeNotExistsException when specified attribute does not exist
154+
* @throws WrongAttributeAssignmentException wrong attribute assignment
155+
*/
156+
List<Resource> getResources(PerunSession sess, Map<String, String> attributesWithSearchingValues) throws PrivilegeException, InternalErrorException, AttributeNotExistsException, WrongAttributeAssignmentException;
136157
}

0 commit comments

Comments
 (0)