Legal issueshttps://community.opengroup.org/osdu/platform/security-and-compliance/legal/-/issues2022-09-27T08:16:58Zhttps://community.opengroup.org/osdu/platform/security-and-compliance/legal/-/issues/25Compliance APIs are inconsistent, causing legal tag status not updated if new...2022-09-27T08:16:58ZAn NgoCompliance APIs are inconsistent, causing legal tag status not updated if new expiration date is within 1 day and associated record not deleted- API Validate Legal Tag: validates the legal tag at the time the API is called. Specifically, it checks for the validation of the properties on the fly.
- API List Legal tag (valid/invalid): returns the list of legal tags whose valid ...- API Validate Legal Tag: validates the legal tag at the time the API is called. Specifically, it checks for the validation of the properties on the fly.
- API List Legal tag (valid/invalid): returns the list of legal tags whose valid flag is true or false. This flag is updated during the daily cron job. Therefore, if the legal tag is update in the afternoon from invalid to valid, but the cron job is not ran until midnight, so there is a period between the afternoon and midnight where the legal tag is still shown as invalid. Therefore, this legal tag would still be returned in the response because its valid flag has not been updated.
Due to the aforementioned inconsistency, the system allows ingestion of records whose associated legal tag is not get marked as valid.
**Use case:**
- LegalTagA expires on February 4. After the cron job, it is marked as valid=false.
- On April 21, LegalTagA is updated with new expiration date of April 22. At time of this update, the valid flag is still false because the cron job has not ran.
- Also on April 21, user creates new records with LegalTagA. At this time, Storage calls ValidateLegalTag -> returns true because at this time, the legal tag is set to expire on April 22 so it is considered valid, so record creation was successful.
- At midnight April 22, the cron job is ran. It finds that LegalTagA has expiration date of April 22. HOWEVER, the valid flag was already false, so nothing was changed. So even though the legal tag was updated earlier in the day, its valid flag was never true. Because the valid flag never changed, the associated records were not updated. In this case, on April 22 the legal tag expires, its associated records were not deleted. Now we have invalid records in the system.
**Fix:**
Fix the API inconsistency should resolve the issue mentioned in the use case, and also allows the correct legal tags to be returned in the Get API.