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 @@
<parent>
<groupId>de.fraunhofer.iese.ind2uce</groupId>
<artifactId>parent</artifactId>
<version>3.1.30</version>
<version>3.1.33</version>
</parent>
<artifactId>core</artifactId>
<packaging>jar</packaging>
<version>3.1.30</version>
<version>3.1.33</version>
<name>IND2UCE :: Core</name>
<description>IND2UCE :: Core</description>
<url>https://git.iese.fraunhofer.de/ind2uce/core</url>
<properties>
<license.licenseName>apache_v2</license.licenseName>
......@@ -58,8 +60,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
......@@ -104,27 +104,93 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</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>
</build>
<distributionManagement>
<repository>
<id>deployment</id>
<name>Internal Releases</name>
<url>http://ind2uce.iese.de/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>deployment</id>
<name>Internal Snapshots</name>
<url>http://ind2uce.iese.de/nexus/content/repositories/snapshots/</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<scm>
<url>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE</url>
<connection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE</connection>
<developerConnection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.30-RELEASE
<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.33-RELEASE</connection>
<developerConnection>scm:svn:https://ind2uce.iese.de/svn/ind2uce/dev2/core/tags/3.1.33-RELEASE
</developerConnection>
</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>
......@@ -2,12 +2,12 @@
Modifications to default asciidoctor theme*/
#toc.toc2 {
background-color:#2582c5;
background-color:#164e78;
border-right: none;
}
#content #toc {
background-color:#2582c5;
background-color:#164e78;
}
#toc a {
......@@ -27,7 +27,7 @@ Modifications to default asciidoctor theme*/
}
#footer {
background-color: #2582c5;
background-color: #164e78;
}
#footer-text {
......@@ -35,12 +35,12 @@ Modifications to default asciidoctor theme*/
}
h1, h2, h3, .sidebarblock > .content > .title, h4, h5, h6 {
color: #2582c5;
color: #164e78;
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 {
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{
......@@ -57,11 +57,11 @@ body {
}
#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 {
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 {
......
......@@ -188,7 +188,8 @@ The second check evaluates whether the number of employees in the project is gre
<preventiveMechanism id='anonymizeEffortsIfEmployeesGreaterEqual5'>
<description>This mechanism anonymizes effort data if a foreman accesses projects with at least 5 employees.</description>
<event action='urn:action:cs4:showProjectEffort'/>
<and>
<condition>
<and>
<function:equals>
<pip:string method='getEmployeeRole' default='EMPLOYEE' ttl='600'>
<param:string name='id'>
......@@ -205,7 +206,8 @@ The second check evaluates whether the number of employees in the project is gre
</function:size>
<constant:int value='5'/>
</function:greaterEqual>
</and>
</and>
</condition>
...
</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;
}
}
......@@ -7,9 +7,9 @@
* 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.
......@@ -22,7 +22,8 @@ package de.fraunhofer.iese.ind2uce.api.component.description;
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.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
......@@ -153,16 +154,16 @@ public class MethodInterfaceDescription extends Ind2uceEntity {
public boolean equals(Object obj) {
if (obj instanceof MethodInterfaceDescription) {
final MethodInterfaceDescription description = (MethodInterfaceDescription)obj;
if (!ObjectUtils.equals(this.getReturnType(), description.getReturnType())) {
if (!Objects.equal(this.getReturnType(), description.getReturnType())) {
return false;
}
if (!ObjectUtils.equals(this.getMethodName(), description.getMethodName())) {
if (!Objects.equal(this.getMethodName(), description.getMethodName())) {
return false;
}
if (!ObjectUtils.equals(this.getDescription(), description.getDescription())) {
if (!Objects.equal(this.getDescription(), description.getDescription())) {
return false;
}
return ObjectUtils.equals(this.parameters, description.getParameters());
return Objects.equal(this.parameters, description.getParameters());
}
return false;
}
......
......@@ -7,9 +7,9 @@
* 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.
......@@ -50,8 +50,20 @@ public class EnforcementScopeId extends Ind2uceEntity {
* @param urn the 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.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 {
}
/**
* Gets the id.
* Gets the identifier.
*
* @return the id
* @return the identifier
*/
public String getId() {
return this.toString();
public String getIdentifier() {
return this.identifier;
}
/*
......@@ -97,7 +109,10 @@ public class EnforcementScopeId extends Ind2uceEntity {
*/
@Override
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 {
*/
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;
}
......@@ -7,9 +7,9 @@
* 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.
......@@ -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.EvaluationUndecidableException;
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.Event;
import de.fraunhofer.iese.ind2uce.api.policy.identifier.PolicyId;
......@@ -72,14 +73,6 @@ public interface IPolicyDecisionPoint extends IComponent {
*/
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.
*
......@@ -99,4 +92,8 @@ public interface IPolicyDecisionPoint extends IComponent {
*/
boolean revokePolicy(PolicyId policyId) throws IOException, IllegalArgumentException, PolicyRevokationException;
boolean addToBlacklist(List<EnforcementScopeId> ids) throws IOException;
boolean removeFromBlacklist(List<EnforcementScopeId> ids) throws IOException;
}
......@@ -7,9 +7,9 @@
* 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.
......@@ -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.PolicyRevokationException;
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.identifier.PolicyId;
......@@ -35,6 +36,7 @@ import java.io.IOException;
import java.util.List;
import java.util.NoSuchElementException;
// TODO: Auto-generated Javadoc
/**
* 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
......@@ -91,19 +93,11 @@ public interface IPolicyManagementPoint extends IComponent {
/**
* Gets all policy.
*
* @param scope the scope
* @return all policy
* @throws IOException Signals that an I/O exception has occurred.
*/
List<Policy> getDeployedPolicies() 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;
List<Policy> getDeployedPolicies(EnforcementScopeId scope) throws IOException;
/**
* Gets the status.
......@@ -118,29 +112,22 @@ public interface IPolicyManagementPoint extends IComponent {
* Describes the enforcement scope as a set of registered components and
* corresponding interfaces.
*
* @param scope the scope
* @param includeInterface a flag that indicates whether the interface
* description of the component should be included in the result
* @return an {@link EnforcementScope} of the local enforcement scope
* @throws IOException if connection problem occurs
*/
EnforcementScope getEnforcementScope(boolean includeInterface) throws IOException;
EnforcementScope getEnforcementScope(EnforcementScopeId scope, boolean includeInterface) throws IOException;
/**
* Gets all policy.
*
* @param scope the scope
* @return all policy
* @throws IOException Signals that an I/O exception has occurred.
*/
List<Policy> getPolicies() 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;
List<Policy> getPolicies(EnforcementScopeId scope) throws IOException;
/**
* Gets the latest policy.
......@@ -154,20 +141,20 @@ public interface IPolicyManagementPoint extends IComponent {
/**
* Gets all policy ids.
*
* @param scope the scope
* @return all policy IDs
* @throws IOException Signals that an I/O exception has occurred.
*/
List<PolicyId> getPolicyIds() throws IOException;
List<PolicyId> getPolicyIds(EnforcementScopeId scope) throws IOException;
/**
* Provides a list of currently deployed policy ids.
*
* @param scope the scope
* @return list of currently deployed policy ids
* @throws IOException communication failure
*/
List<PolicyId> listDeployedPolicies() throws IOException;
List<PolicyId> listDeployedPolicies(EnforcementScopeId scope) throws IOException;
/**
* Lookup by {@link ComponentId}.
......@@ -181,45 +168,46 @@ public interface IPolicyManagementPoint extends IComponent {
/**
* Returns the list of PDPs in the database.
*
* @param includeInterface flag to include the interface (URLs and
* {@link MethodInterfaceDescription}s
* @return the PDP in the database
* @throws IOException communication failure
*/
Component lookupPdp(boolean includeInterface) throws IOException;
Component lookupPdp() throws IOException;
/**
* Returns the list of PEPs in the database.
* Lookup by {@link ComponentId}.
*
* @param includeInterface flag to include the interface (URLs and
* {@link MethodInterfaceDescription}s
* @return the list of PEPs in the database
* @param id the id
* @return the component
* @throws IOException communication failure
*/
List<PepComponent> lookupPep(boolean includeInterface) throws IOException;
PepComponent lookupPep(ComponentId id) throws IOException;
/**
* Lookup by {@link ComponentId}.
* Returns the list of PEPs in the database.
*
* @param id the id
* @return the component
* @param scope the scope
* @param includeInterface flag to include the interface (URLs and
* {@link MethodInterfaceDescription}s
* @return the list of PEPs in the database
* @throws IOException communication failure
*/
PepComponent lookupPep(ComponentId id) throws IOException;
List<PepComponent> lookupPep(EnforcementScopeId scope, boolean includeInterface) throws IOException;
/**
* Returns the list of PIPs in the database.
*
* @param scope the scope
* @param includeInterface flag to include the interface (URLs and
* {@link MethodInterfaceDescription}s
* @return the list of PIPs in the database
* @throws IOException communication failure
*/
List<Component> lookupPip(boolean includeInterface) throws IOException;
List<Component> lookupPip(EnforcementScopeId scope, boolean includeInterface) throws IOException;
/**
* Returns the list of PIPs in the database.
*
* @param scope the scope
* @param includeInterface flag to include the interface (URLs and
* {@link MethodInterfaceDescription}s
* @param query the required / available {@link MethodInterfaceDescription}s
......@@ -227,21 +215,23 @@ public interface IPolicyManagementPoint extends IComponent {
* @return the list of PIPs in the database
* @throws IOException communication failure
*/
List<Component> lookupPip(boolean includeInterface, MethodInterfaceDescription query) throws IOException;
List<Component> lookupPip(EnforcementScopeId scope, boolean includeInterface, MethodInterfaceDescription query) throws IOException;