Commit 7f5e9d2c authored by raj.shah@iese.fraunhofer.de's avatar raj.shah@iese.fraunhofer.de
Browse files

Release 3.1.33

parent 94c307b0
...@@ -3,14 +3,16 @@ ...@@ -3,14 +3,16 @@
<parent> <parent>
<groupId>de.fraunhofer.iese.ind2uce</groupId> <groupId>de.fraunhofer.iese.ind2uce</groupId>
<artifactId>parent</artifactId> <artifactId>parent</artifactId>
<version>3.1.30</version> <version>3.1.33</version>
</parent> </parent>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>3.1.30</version> <version>3.1.33</version>
<name>IND2UCE :: Core</name> <name>IND2UCE :: Core</name>
<description>IND2UCE :: Core</description> <description>IND2UCE :: Core</description>
<url>https://git.iese.fraunhofer.de/ind2uce/core</url>
<properties> <properties>
<license.licenseName>apache_v2</license.licenseName> <license.licenseName>apache_v2</license.licenseName>
...@@ -58,8 +60,6 @@ ...@@ -58,8 +60,6 @@
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId> <artifactId>hibernate-entitymanager</artifactId>
...@@ -104,27 +104,93 @@ ...@@ -104,27 +104,93 @@
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId> <artifactId>license-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>-->
</plugins> </plugins>
</build> </build>
<distributionManagement> <distributionManagement>
<repository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://ind2uce.iese.de/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository> <snapshotRepository>
<id>deployment</id> <id>ossrh</id>
<name>Internal Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url>
<url>http://ind2uce.iese.de/nexus/content/repositories/snapshots/</url>
</snapshotRepository> </snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement> </distributionManagement>
<scm> <scm>
<url>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE</url> <url>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.33-RELEASE</url>
<connection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE</connection> <connection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.33-RELEASE</connection>
<developerConnection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE <developerConnection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.33-RELEASE
</developerConnection> </developerConnection>
</scm> </scm>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Denis Feth</name>
<email>denis.feth@iese.fraunhofer.de</email>
<organization>Fraunhofer IESE</organization>
<organizationUrl>https://www.iese.fraunhofer.de/</organizationUrl>
</developer>
<developer>
<name>Andreas Eitel</name>
<email>andreas.eitel@iese.fraunhofer.de</email>
<organization>Fraunhofer IESE</organization>
<organizationUrl>https://www.iese.fraunhofer.de/</organizationUrl>
</developer>
<developer>
<name>Raj Shah</name>
<email>raj.shah@iese.fraunhofer.de</email>
<organization>Fraunhofer IESE</organization>
<organizationUrl>https://www.iese.fraunhofer.de/</organizationUrl>
</developer>
</developers>
</project> </project>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
Modifications to default asciidoctor theme*/ Modifications to default asciidoctor theme*/
#toc.toc2 { #toc.toc2 {
background-color:#2582c5; background-color:#164e78;
border-right: none; border-right: none;
} }
#content #toc { #content #toc {
background-color:#2582c5; background-color:#164e78;
} }
#toc a { #toc a {
...@@ -27,7 +27,7 @@ Modifications to default asciidoctor theme*/ ...@@ -27,7 +27,7 @@ Modifications to default asciidoctor theme*/
} }
#footer { #footer {
background-color: #2582c5; background-color: #164e78;
} }
#footer-text { #footer-text {
...@@ -35,12 +35,12 @@ Modifications to default asciidoctor theme*/ ...@@ -35,12 +35,12 @@ Modifications to default asciidoctor theme*/
} }
h1, h2, h3, .sidebarblock > .content > .title, h4, h5, h6 { h1, h2, h3, .sidebarblock > .content > .title, h4, h5, h6 {
color: #2582c5; color: #164e78;
font-family: "Helvetica Neue", Roboto, Arial, "Droid Sans", sans-serif; font-family: "Helvetica Neue", Roboto, Arial, "Droid Sans", sans-serif;
} }
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link { #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link {
color:#2582c5 color:#164e78
} }
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{ #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{
...@@ -57,11 +57,11 @@ body { ...@@ -57,11 +57,11 @@ body {
} }
#header > h1:first-child { #header > h1:first-child {
color: #2582c5; color: #164e78;
} }
.subheader,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title { .subheader,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title {
color:#2582c5; color:#164e78;
} }
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title { .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title {
......
...@@ -188,6 +188,7 @@ The second check evaluates whether the number of employees in the project is gre ...@@ -188,6 +188,7 @@ The second check evaluates whether the number of employees in the project is gre
<preventiveMechanism id='anonymizeEffortsIfEmployeesGreaterEqual5'> <preventiveMechanism id='anonymizeEffortsIfEmployeesGreaterEqual5'>
<description>This mechanism anonymizes effort data if a foreman accesses projects with at least 5 employees.</description> <description>This mechanism anonymizes effort data if a foreman accesses projects with at least 5 employees.</description>
<event action='urn:action:cs4:showProjectEffort'/> <event action='urn:action:cs4:showProjectEffort'/>
<condition>
<and> <and>
<function:equals> <function:equals>
<pip:string method='getEmployeeRole' default='EMPLOYEE' ttl='600'> <pip:string method='getEmployeeRole' default='EMPLOYEE' ttl='600'>
...@@ -206,6 +207,7 @@ The second check evaluates whether the number of employees in the project is gre ...@@ -206,6 +207,7 @@ The second check evaluates whether the number of employees in the project is gre
<constant:int value='5'/> <constant:int value='5'/>
</function:greaterEqual> </function:greaterEqual>
</and> </and>
</condition>
... ...
</preventiveMechanism> </preventiveMechanism>
... ...
......
/*-
* =================================LICENSE_START=================================
* IND2UCE
* %%
* Copyright (C) 2016 Fraunhofer IESE (www.iese.fraunhofer.de)
* %%
* 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.
* =================================LICENSE_END=================================
*/
/**
*
*/
package de.fraunhofer.iese.ind2uce.api.common;
/**
* Roles fpr the PMP.
*
* @author Bernd Peltzer-Bartels
*/
public enum Ind2uceRole {
SOLUTION_DEVELOPER("Developer"), ADMINISTRATOR("Admin"),
/**
* This role is not stored with user. It' for components, only.
*/
PDP("PDP"), CLIENT("CLIENT");
private final String text;
private Ind2uceRole(final String text) {
this.text = text;
}
/**
* To spring role.
*
* @return the string
*/
public String toSpringRole() {
return "ROLE_" + this.name();
}
@Override
public String toString() {
return this.text;
}
}
...@@ -22,7 +22,8 @@ package de.fraunhofer.iese.ind2uce.api.component.description; ...@@ -22,7 +22,8 @@ package de.fraunhofer.iese.ind2uce.api.component.description;
import de.fraunhofer.iese.ind2uce.api.common.Ind2uceEntity; import de.fraunhofer.iese.ind2uce.api.common.Ind2uceEntity;
import org.apache.commons.lang3.ObjectUtils; import com.google.common.base.Objects;
import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hibernate.annotations.Fetch; import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.FetchMode;
...@@ -153,16 +154,16 @@ public class MethodInterfaceDescription extends Ind2uceEntity { ...@@ -153,16 +154,16 @@ public class MethodInterfaceDescription extends Ind2uceEntity {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj instanceof MethodInterfaceDescription) { if (obj instanceof MethodInterfaceDescription) {
final MethodInterfaceDescription description = (MethodInterfaceDescription)obj; final MethodInterfaceDescription description = (MethodInterfaceDescription)obj;
if (!ObjectUtils.equals(this.getReturnType(), description.getReturnType())) { if (!Objects.equal(this.getReturnType(), description.getReturnType())) {
return false; return false;
} }
if (!ObjectUtils.equals(this.getMethodName(), description.getMethodName())) { if (!Objects.equal(this.getMethodName(), description.getMethodName())) {
return false; return false;
} }
if (!ObjectUtils.equals(this.getDescription(), description.getDescription())) { if (!Objects.equal(this.getDescription(), description.getDescription())) {
return false; return false;
} }
return ObjectUtils.equals(this.parameters, description.getParameters()); return Objects.equal(this.parameters, description.getParameters());
} }
return false; return false;
} }
......
...@@ -50,8 +50,20 @@ public class EnforcementScopeId extends Ind2uceEntity { ...@@ -50,8 +50,20 @@ public class EnforcementScopeId extends Ind2uceEntity {
* @param urn the urn * @param urn the urn
*/ */
public EnforcementScopeId(String urn) { public EnforcementScopeId(String urn) {
if (urn == null) {
throw new IllegalArgumentException("Illegal Enforcement Scope ID");
} else if (!urn.startsWith("urn:es:")) {
urn = "urn:es:" + urn;
}
this.validate(urn); this.validate(urn);
this.identifier = urn; if (URN_ES_PATTERN.matcher(urn).find()) {
final String[] componentIdParts = urn.split(":");
this.identifier = componentIdParts[2];
} else {
throw new IllegalArgumentException(urn);
}
} }
/* /*
...@@ -74,12 +86,12 @@ public class EnforcementScopeId extends Ind2uceEntity { ...@@ -74,12 +86,12 @@ public class EnforcementScopeId extends Ind2uceEntity {
} }
/** /**
* Gets the id. * Gets the identifier.
* *
* @return the id * @return the identifier
*/ */
public String getId() { public String getIdentifier() {
return this.toString(); return this.identifier;
} }
/* /*
...@@ -97,7 +109,10 @@ public class EnforcementScopeId extends Ind2uceEntity { ...@@ -97,7 +109,10 @@ public class EnforcementScopeId extends Ind2uceEntity {
*/ */
@Override @Override
public String toString() { public String toString() {
return this.identifier; final StringBuilder s = new StringBuilder();
s.append("urn:es:");
s.append(this.identifier);
return s.toString();
} }
/** /**
......
...@@ -60,4 +60,11 @@ public interface IComponent extends Serializable { ...@@ -60,4 +60,11 @@ public interface IComponent extends Serializable {
*/ */
boolean reset() throws IOException; boolean reset() throws IOException;
/**
* Checks whether a component is up and running.
*
* @return a string describing the health status. In case of spring applications, a JSON of Health.class representation is used.
* @throws IOException
*/
String getHealth() throws IOException;
} }
...@@ -23,6 +23,7 @@ package de.fraunhofer.iese.ind2uce.api.component.interfaces; ...@@ -23,6 +23,7 @@ package de.fraunhofer.iese.ind2uce.api.component.interfaces;
import de.fraunhofer.iese.ind2uce.api.component.exception.ConflictingPolicyException; import de.fraunhofer.iese.ind2uce.api.component.exception.ConflictingPolicyException;
import de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException; import de.fraunhofer.iese.ind2uce.api.component.exception.EvaluationUndecidableException;
import de.fraunhofer.iese.ind2uce.api.component.exception.PolicyRevokationException; import de.fraunhofer.iese.ind2uce.api.component.exception.PolicyRevokationException;
import de.fraunhofer.iese.ind2uce.api.component.identifier.EnforcementScopeId;
import de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision; import de.fraunhofer.iese.ind2uce.api.policy.AuthorizationDecision;
import de.fraunhofer.iese.ind2uce.api.policy.Event; import de.fraunhofer.iese.ind2uce.api.policy.Event;
import de.fraunhofer.iese.ind2uce.api.policy.identifier.PolicyId; import de.fraunhofer.iese.ind2uce.api.policy.identifier.PolicyId;
...@@ -72,14 +73,6 @@ public interface IPolicyDecisionPoint extends IComponent { ...@@ -72,14 +73,6 @@ public interface IPolicyDecisionPoint extends IComponent {
*/ */
boolean deploy(String policy) throws IOException, IllegalArgumentException, ConflictingPolicyException; boolean deploy(String policy) throws IOException, IllegalArgumentException, ConflictingPolicyException;
/**
* Returns the version of the PDP.
*
* @return the version of the PDP
* @throws IOException if there occurs a connection problem.
*/
String getNativeLibraryVersion() throws IOException;
/** /**
* Provides a list of currently deployed policy names. * Provides a list of currently deployed policy names.
* *
...@@ -99,4 +92,8 @@ public interface IPolicyDecisionPoint extends IComponent { ...@@ -99,4 +92,8 @@ public interface IPolicyDecisionPoint extends IComponent {
*/ */
boolean revokePolicy(PolicyId policyId) throws IOException, IllegalArgumentException, PolicyRevokationException; boolean revokePolicy(PolicyId policyId) throws IOException, IllegalArgumentException, PolicyRevokationException;
boolean addToBlacklist(List<EnforcementScopeId> ids) throws IOException;
boolean removeFromBlacklist(List<EnforcementScopeId> ids) throws IOException;
} }
...@@ -28,6 +28,7 @@ import de.fraunhofer.iese.ind2uce.api.component.description.MethodInterfaceDescr ...@@ -28,6 +28,7 @@ import de.fraunhofer.iese.ind2uce.api.component.description.MethodInterfaceDescr
import de.fraunhofer.iese.ind2uce.api.component.exception.ConflictingPolicyException; import de.fraunhofer.iese.ind2uce.api.component.exception.ConflictingPolicyException;
import de.fraunhofer.iese.ind2uce.api.component.exception.PolicyRevokationException; import de.fraunhofer.iese.ind2uce.api.component.exception.PolicyRevokationException;
import de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId; import de.fraunhofer.iese.ind2uce.api.component.identifier.ComponentId;
import de.fraunhofer.iese.ind2uce.api.component.identifier.EnforcementScopeId;
import de.fraunhofer.iese.ind2uce.api.policy.Policy; import de.fraunhofer.iese.ind2uce.api.policy.Policy;
import de.fraunhofer.iese.ind2uce.api.policy.identifier.PolicyId; import de.fraunhofer.iese.ind2uce.api.policy.identifier.PolicyId;
...@@ -35,6 +36,7 @@ import java.io.IOException; ...@@ -35,6 +36,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
// TODO: Auto-generated Javadoc
/** /**
* Client Interface of the Policy Management Point. It is mainly responsible to * Client Interface of the Policy Management Point. It is mainly responsible to
* manage local components and to deploy policies at the PDP of the enforcement * manage local components and to deploy policies at the PDP of the enforcement
...@@ -91,19 +93,11 @@ public interface IPolicyManagementPoint extends IComponent { ...@@ -91,19 +93,11 @@ public interface IPolicyManagementPoint extends IComponent {
/** /**
* Gets all policy. * Gets all policy.
* *
* @param scope the scope
* @return all policy * @return all policy
* @throws IOException Signals that an I/O exception has occurred. * @throws IOException Signals that an I/O exception has occurred.
*/ */
List<Policy> getDeployedPolicies() throws IOException; List<Policy> getDeployedPolicies(EnforcementScopeId scope) throws IOException;
/**
* Get deployed policies by solution.
*
* @param solutionId the solution id
* @return the deployed policies
* @throws IOException Signals that an I/O exception has occurred.
*/
List<Policy> getDeployedPolicies(String solutionId) throws IOException;
/** /**
* Gets the status. * Gets the status.
...@@ -118,29 +112,22 @@ public interface IPolicyManagementPoint extends IComponent { ...@@ -118,29 +112,22 @@ public interface IPolicyManagementPoint extends IComponent {
* Describes the enforcement scope as a set of registered components and * Describes the enforcement scope as a set of registered components and
* corresponding interfaces. * corresponding interfaces.
* *
* @param scope the scope
* @param includeInterface a flag that indicates whether the interface * @param includeInterface a flag that indicates whether the interface
* description of the component should be included in the result * description of the component should be included in the result
* @return an {@link EnforcementScope} of the local enforcement scope * @return an {@link EnforcementScope} of the local enforcement scope
* @throws IOException if connection problem occurs * @throws IOException if connection problem occurs
*/ */
EnforcementScope getEnforcementScope(boolean includeInterface) throws IOException; EnforcementScope getEnforcementScope(EnforcementScopeId scope, boolean includeInterface) throws IOException;
/** /**
* Gets all policy. * Gets all policy.
* *
* @param scope the scope
* @return all policy * @return all policy
* @throws IOException Signals that an I/O exception has occurred. * @throws IOException Signals that an I/O exception has occurred.
*/ */
List<Policy> getPolicies() throws IOException; List<Policy> getPolicies(EnforcementScopeId scope) throws IOException;
/**
* Get policies by solution.
*
* @param solutionId the solution id
* @return the policies
* @throws IOException Signals that an I/O exception has occurred.
*/
List<Policy> getPolicies(String solutionId) throws IOException;
/** /**