diff --git a/NOTICE b/NOTICE
index b89aa6217ca8093488a8fd95ab15900e5944baac..55fd5e32be42a88da2d3cf9a153d2a67d4005328 100644
--- a/NOTICE
+++ b/NOTICE
@@ -439,7 +439,7 @@ The following software have components provided under the terms of this license:
- Jackson datatype: Joda (from http://wiki.fasterxml.com/JacksonModuleJoda, https://github.com/FasterXML/jackson-datatype-joda)
- Jackson datatype: jdk8 (from https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jdk8)
- Jackson module: Afterburner (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-modules-base)
-- Jackson-annotations (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome)
+- Jackson-annotations (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson)
- Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core)
- Jackson-dataformat-XML (from http://wiki.fasterxml.com/JacksonExtensionXmlDataBinding, https://github.com/FasterXML/jackson-dataformat-xml)
- Jackson-dataformat-YAML (from https://github.com/FasterXML/jackson, https://github.com/FasterXML/jackson-dataformats-text)
@@ -606,7 +606,7 @@ The following software have components provided under the terms of this license:
- io.grpc:grpc-protobuf-lite (from https://github.com/grpc/grpc-java)
- io.grpc:grpc-stub (from https://github.com/grpc/grpc-java)
- ion-java (from https://github.com/amzn/ion-java/, https://github.com/amznlabs/ion-java/)
-- jackson-databind (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome)
+- jackson-databind (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson)
- java-cloudant (from https://cloudant.com)
- javatuples (from http://www.javatuples.org)
- javax.annotation-api (from http://jcp.org/en/jsr/detail?id=250)
@@ -1168,6 +1168,8 @@ The following software have components provided under the terms of this license:
========================================================================
unknown
========================================================================
+The following software have components provided under the terms of this license:
+
- Bouncy Castle Provider (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html)
- Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy)
- Checker Qual (from https://checkerframework.org)
@@ -1181,7 +1183,10 @@ unknown
- JUnit Platform Engine API (from http://junit.org/junit5/, https://junit.org/junit5/)
- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api)
- Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec)
-- xml-apis
+- Java Native Access (from https://github.com/java-native-access/jna, https://github.com/twall/jna, https://repo1.maven.org/maven2/net/java/dev/jna/jna)
+- Java Native Access Platform (from https://github.com/java-native-access/jna)
+- System Rules (from http://stefanbirkner.github.com/system-rules/, http://stefanbirkner.github.io/system-rules/)
+- xml-apis (from https://repo1.maven.org/maven2/xml-apis/xml-apis)
========================================================================
xpp
diff --git a/docs/api/compliance_openapi.yaml b/docs/api/compliance_openapi.yaml
index c786091619d9e9400e9e4f3e9b512bf2e5bfd6ca..c256b1c817b6095bd6033c7196185f16fe727b99 100644
--- a/docs/api/compliance_openapi.yaml
+++ b/docs/api/compliance_openapi.yaml
@@ -478,6 +478,10 @@ definitions:
type: string
example: EAR99
description: The ECCN value of the data if one applies.
+ extensionProperties:
+ type: object
+ additionalProperties: true
+ description: The optional object field to attach any company specific attributes.
description: LegalTag properties
UpdateLegalTag:
type: object
@@ -498,7 +502,11 @@ definitions:
expirationDate:
type: string
example: '2025-12-25'
- description: The optional expiration date of the contract in the format YYYY-MM-DD
+ description: The optional expiration date of the contract in the format YYYY-MM-DD.
+ extensionProperties:
+ type: object
+ additionalProperties: true
+ description: The optional object field to attach any company specific attributes.
description: The model to update an existing LegalTag
VersionInfo:
type: "object"
diff --git a/docs/tutorial/ComplianceService.md b/docs/tutorial/ComplianceService.md
index 1e093882efadb0bdda05af0287ad5100c66404a4..75d66eaf7e3c3afc367d1dfe0a2cdc5c0a684643 100644
--- a/docs/tutorial/ComplianceService.md
+++ b/docs/tutorial/ComplianceService.md
@@ -101,7 +101,10 @@ curl --request POST \
"originator":"OSDU",
"securityClassification":"Public",
"exportClassification":"EAR99",
- "personalData":"No Personal Data"
+ "personalData":"No Personal Data",
+ "extensionProperties": {
+ "anyCompanySpecificAttributes": "anyJsonTypeOfvalue"
+ }
}
}'
```
@@ -110,6 +113,8 @@ curl --request POST \
It is good practice for LegalTag names to be clear and descriptive of the properties it represents, so it would be easy to discover and to associate to the correct data with it. Also, the description field is a free form optional field to allow for you to add context to the LegalTag, making easier to understand and retrieve over time.
+The "extensionProperties" field is an optional json object field and you may add any company specific attributes inside this field.
+
When creating LegalTags, the name is automatically prefixed with the data-partition-name that is assigned to the partition. So in the example above, if the given data-partition-name is **mypartition**, then the actual name of the LegalTag would be **mypartition-demo-legaltag**.
Valid values: The legalTag name needs to be between 3 and 100 characters and only alphanumeric characters and hyphens are allowed
@@ -435,7 +440,7 @@ Ingestion services forward the request to the LegalTag API using the same _SAuth
## Updating a LegalTag
One of the main cases where a LegalTag can become invalid is if a contract expiration date passes. This makes both the LegalTag invalid and *all* data associated with that LegalTag including derivatives.
-In these situations we can update LegalTags to make them valid again and so make the associated data accessible. Currently we only allow the update of the *description*, *contract ID* and *expiration date* properties.
+In these situations we can update LegalTags to make them valid again and so make the associated data accessible. Currently we only allow the update of the *description*, *contract ID*, *expiration date* and *extensionProperties* properties.
PUT /api/legal/v1/legaltags
@@ -450,8 +455,11 @@ curl --request PUT \
--header 'data-partition-id: opendes' \
--data '{
"name": "opendes-demo-legaltag",
- "contractId": "AE12345"
- "expirationDate": "2099-12-21"
+ "contractId": "AE12345",
+ "expirationDate": "2099-12-21",
+ "extensionProperties": {
+ "anyCompanySpecificAttributes": "anyJsonTypeOfvalue"
+ }
}
}'
```
diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/provider/interfaces/ILegalTagRepository.java b/legal-core/src/main/java/org/opengroup/osdu/legal/provider/interfaces/ILegalTagRepository.java
index de0afe8be9bb585a75b6380509e7839d72d1d2cc..6bd611f0dbbf830d95ea7d80ef2007fd34e709ad 100644
--- a/legal-core/src/main/java/org/opengroup/osdu/legal/provider/interfaces/ILegalTagRepository.java
+++ b/legal-core/src/main/java/org/opengroup/osdu/legal/provider/interfaces/ILegalTagRepository.java
@@ -18,6 +18,7 @@ public interface ILegalTagRepository {
String SECURITY_CLASSIFICATION = "securityClassification";
String EXPORT_CLASSIFICATION = "exportClassification";
String PERSONAL_DATA = "personalData";
+ String EXTENSION_PROPERTIES = "extensionProperties";
String DESCRIPTION = "description";
String NAME = "name";
diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java
index 6ca294ee6217f3a93b3e2b9c7b341f7eb0a2934a..e7cca25a5fdaecb2e1bc2bb318a757ece50455fc 100644
--- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java
+++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/LegalTagService.java
@@ -166,6 +166,7 @@ public class LegalTagService {
currentLegalTag.getProperties().setContractId(newLegalTag.getContractId());
currentLegalTag.getProperties().setExpirationDate(newLegalTag.getExpirationDate());
+ currentLegalTag.getProperties().setExtensionProperties(newLegalTag.getExtensionProperties());
currentLegalTag.setDescription(newLegalTag.getDescription());
validator.isValidThrows(currentLegalTag);
diff --git a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/UpdateLegalTag.java b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/UpdateLegalTag.java
index b4cc4a4e4a2d3fb3b7edab848d65c263f375ffe6..d8cd24cd6d5244211636afc9319eb49d7ec03900 100644
--- a/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/UpdateLegalTag.java
+++ b/legal-core/src/main/java/org/opengroup/osdu/legal/tags/dto/UpdateLegalTag.java
@@ -1,6 +1,8 @@
package org.opengroup.osdu.legal.tags.dto;
import java.sql.Date;
+import java.util.Map;
+
import org.opengroup.osdu.core.common.model.legal.validation.ValidDescription;
import org.opengroup.osdu.core.common.model.legal.validation.ValidName;
import lombok.AllArgsConstructor;
@@ -24,4 +26,6 @@ public class UpdateLegalTag {
private String description = "";
private Date expirationDate;
+
+ private Map extensionProperties;
}
diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTagServiceTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTagServiceTests.java
index fb1420ba04bcc8b1d2c65fbf3910cc4e49699084..bf849ff699e89ef05c60680d4416b4790e7418f5 100644
--- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTagServiceTests.java
+++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTagServiceTests.java
@@ -264,6 +264,7 @@ public class LegalTagServiceTests {
assertEquals(result.getName(), updateTag.getName());
assertEquals(result.getProperties().getContractId(), updateTag.getContractId());
assertEquals(result.getProperties().getExpirationDate(), updateTag.getExpirationDate());
+ assertEquals(result.getProperties().getExtensionProperties(), updateTag.getExtensionProperties());
assertEquals(result.getDescription(), updateTag.getDescription());
verify(validator, times(1)).isValidThrows(any());
}
diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTestUtils.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTestUtils.java
index 6cd22cf95d0c43c960d292795583dd94506d3054..1d29c6d605e28c190377108503d7927e3bb9f249 100644
--- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTestUtils.java
+++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/LegalTestUtils.java
@@ -7,6 +7,9 @@ import org.opengroup.osdu.core.common.model.legal.LegalTag;
import org.opengroup.osdu.core.common.model.legal.Properties;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
public class LegalTestUtils {
public static LegalTag createValidLegalTag(String name){
@@ -27,6 +30,16 @@ public class LegalTestUtils {
properties.setPersonalData("Sensitive Personal Information");
properties.setSecurityClassification("Confidential");
properties.setExportClassification("ECCN");
+
+ Map extensionProperties = new LinkedHashMap ();
+ extensionProperties.put("EffectiveDate", "2022-06-01T00:00:00");
+ extensionProperties.put("AffiliateEnablementIndicator", true);
+ Map agreementParty = new LinkedHashMap ();
+ agreementParty.put("AgreementPartyType", "EnabledAffiliate");
+ agreementParty.put("AgreementParty", "osdu:master-data--Organisation:TestCompany");
+ extensionProperties.put("AgreementParties", Arrays.asList(agreementParty));
+ properties.setExtensionProperties(extensionProperties);
+
return properties;
}
public static UpdateLegalTag createUpdateLegalTag(String name){
@@ -35,6 +48,15 @@ public class LegalTestUtils {
legalTag.setContractId("abc123");
legalTag.setName(name);
legalTag.setDescription("myDescription");
+
+ Map extensionProperties = new LinkedHashMap ();
+ extensionProperties.put("EffectiveDate", "2022-06-01T00:00:00");
+ extensionProperties.put("AffiliateEnablementIndicator", false);
+ Map agreementParty = new LinkedHashMap ();
+ agreementParty.put("AgreementPartyType", "PurchaseOrganisation");
+ agreementParty.put("AgreementParty", "osdu:master-data--Organisation:TestCompany");
+ extensionProperties.put("AgreementParties", Arrays.asList(agreementParty));
+
return legalTag;
}
public static LegalTagDto createValidLegalTagDto(String name){
diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java
index bff50675c8efed9cfb09f6d7235c7169275b3fb4..1226db0b80ed81d276f79ed66bf2161fc373837e 100644
--- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java
+++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/LegalTagTests.java
@@ -109,6 +109,16 @@ public class LegalTagTests {
properties.setPersonalData("Personally Identifiable");
properties.setSecurityClassification("Confidential");
properties.setExportClassification("EAR99");
+
+ Map extensionProperties = new LinkedHashMap ();
+ extensionProperties.put("EffectiveDate", "2022-06-01T00:00:00");
+ extensionProperties.put("AffiliateEnablementIndicator", true);
+ Map agreementParty = new LinkedHashMap ();
+ agreementParty.put("AgreementPartyType", "EnabledAffiliate");
+ agreementParty.put("AgreementParty", "osdu:master-data--Organisation:TestCompany");
+ extensionProperties.put("AgreementParties", Arrays.asList(agreementParty));
+ properties.setExtensionProperties(extensionProperties);
+
LegalTag legalTag = new LegalTag();
legalTag.setProperties(properties);
legalTag.setId(1L);
diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java
index c7e154292f88fa1bc10895e52e3013fb337353fa..b5ec0de0cb078f82f40f41a4890d2810dda091ef 100644
--- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java
+++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/model/PropertiesTests.java
@@ -152,6 +152,15 @@ public class PropertiesTests {
sut.setSecurityClassification("Confidential");
sut.setExportClassification("EAR99");
sut.setExpirationDate(Properties.DEFAULT_EXPIRATIONDATE);
+
+ Map extensionProperties = new LinkedHashMap ();
+ extensionProperties.put("EffectiveDate", "2022-06-01T00:00:00");
+ extensionProperties.put("AffiliateEnablementIndicator", true);
+ Map agreementParty = new LinkedHashMap ();
+ agreementParty.put("AgreementPartyType", "EnabledAffiliate");
+ agreementParty.put("AgreementParty", "osdu:master-data--Organisation:TestCompany");
+ extensionProperties.put("AgreementParties", Arrays.asList(agreementParty));
+ sut.setExtensionProperties(extensionProperties);
return sut;
}
diff --git a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java
index ba8b974de76e74be448443e6ca08b52bdf714f30..0309e823b4db6e69f83f0c9af477400312c45a1a 100644
--- a/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java
+++ b/legal-core/src/test/java/org/opengroup/osdu/legal/tags/validation/PropertiesValidatorTests.java
@@ -14,6 +14,8 @@ import java.sql.Date;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
import static junit.framework.TestCase.assertTrue;
import static org.junit.Assert.assertFalse;
@@ -217,6 +219,16 @@ public class PropertiesValidatorTests {
properties.setOriginator(originator);
properties.setExpirationDate(ts);
properties.setCountryOfOrigin(new ArrayList(){{add("FR");}});
+
+ Map extensionProperties = new LinkedHashMap ();
+ extensionProperties.put("EffectiveDate", "2022-06-01T00:00:00");
+ extensionProperties.put("AffiliateEnablementIndicator", true);
+ Map agreementParty = new LinkedHashMap ();
+ agreementParty.put("AgreementPartyType", "EnabledAffiliate");
+ agreementParty.put("AgreementParty", "osdu:master-data--Organisation:TestCompany");
+ extensionProperties.put("AgreementParties", Arrays.asList(agreementParty));
+ properties.setExtensionProperties(extensionProperties);
+
return properties;
}
}
diff --git a/pom.xml b/pom.xml
index 09bff37c464c5defdc49ef1d6824b9e16543c66d..2b6941c226d64cadcf2f3285ca51d1acc48b3152 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,13 +8,14 @@
1.8
opendes
UTF-8
- 0.16.0
+ 0.17.0-rc4
1.26
1.7.0
3.0.0
2.17.1
2.4.7
2.13.2.2
+ 2.13.2
@@ -60,7 +61,19 @@
-
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ 2.4.12
+ pom
+ import
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ 2.4.12
+
org.opengroup.osdu
os-core-common
@@ -108,6 +121,16 @@
json-smart
${json-smart.version}
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson.version}
+
com.fasterxml.jackson.core
jackson-databind