-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72658/
-----------------------------------------------------------

Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, and Sarath 
Subramanian.


Bugs: ATLAS-3877
    https://issues.apache.org/jira/browse/ATLAS-3877


Repository: atlas


Description
-------

ATLAS-3877: Audit Fixed the authorization for audit both in case of non purged 
entity to populate classifcation and purged entity by getting the header from 
HBase Audit


Diffs
-----

  
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
 717310daf 
  
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
 bf1629cb3 
  webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 88de8b679 


Diff: https://reviews.apache.org/r/72658/diff/1/


Testing
-------

#Deleted Entity
//Allow
curl --location --request GET 
'http://sid-ycloud-atlas1-2.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/196bf3a9-07c6-4152-82ad-10176c5df5b9/audit?count=1&auditAction=ENTITY_DELETE'
 \
-u admin:admin123

Response:
[{"entityId":"196bf3a9-07c6-4152-82ad-10176c5df5b9","timestamp":1594192518488,"user":"admin","action":"ENTITY_DELETE","details":"Deleted
 
entity","eventKey":"196bf3a9-07c6-4152-82ad-10176c5df5b9:1594192518488:1:1594192519277","entity":null,"type":null}]

//Deny
curl --location --request GET 
'http://sid-ycloud-atlas1-2.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/196bf3a9-07c6-4152-82ad-10176c5df5b9/audit?count=1&auditAction=ENTITY_DELETE'
 \
-u sid:sid

Response:
{"errorCode":"ATLAS-403-00-001","errorMessage":"sid is not authorized to 
perform read entity: guid=196bf3a9-07c6-4152-82ad-10176c5df5b9"}


#Purged Entity
//Allow
curl --location --request GET 
'http://sid-ycloud-atlas1-2.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/def375bd-9bad-42f3-9fa7-9edc1c7d8d96/audit?count=1&auditAction=ENTITY_PURGE'
 \
-u admin:admin123

Response:
[{"entityId":"def375bd-9bad-42f3-9fa7-9edc1c7d8d96","timestamp":1594191071761,"user":"admin","action":"ENTITY_PURGE","details":"Purged:
 
{\"typeName\":\"hive_table\",\"attributes\":{\"owner\":\"admin\",\"createTime\":1594177077000,\"qualifiedName\":\"default.test_july_7_2020_ctas_10@cm\",\"name\":\"test_july_7_2020_ctas_10\"},\"guid\":\"def375bd-9bad-42f3-9fa7-9edc1c7d8d96\",\"isIncomplete\":false,\"provenanceType\":0,\"status\":\"DELETED\",\"version\":0,\"classifications\":[{\"typeName\":\"NOT_IMP\",\"entityGuid\":\"5f52ee87-85c8-46ac-ad38-e0e5be935bb2\",\"entityStatus\":\"ACTIVE\",\"propagate\":true,\"validityPeriods\":[],\"removePropagationsOnEntityDelete\":false},{\"typeName\":\"PARENT\",\"entityGuid\":\"73cc5730-494b-4313-8747-9ccf8a1b0227\",\"entityStatus\":\"ACTIVE\",\"propagate\":true,\"validityPeriods\":[],\"removePropagationsOnEntityDelete\":false}],\"meanings\":[],\"proxy\":false}","eventKey":"def375bd-9bad-42f3-9fa7-9edc1c7d8d96:1594191071761:3:1594191103634","entity":null
 ,"type":null}]

//Deny
curl --location --request GET 
'http://sid-ycloud-atlas1-2.sid-ycloud-atlas1.root.hwx.site:31000/api/atlas/v2/entity/def375bd-9bad-42f3-9fa7-9edc1c7d8d96/audit?count=1&auditAction=ENTITY_PURGE'
 \
-u sid:sid

Response:
{"errorCode":"ATLAS-403-00-001","errorMessage":"sid is not authorized to 
perform read entity audit: guid=def375bd-9bad-42f3-9fa7-9edc1c7d8d96"}


Thanks,

Sidharth Mishra

Reply via email to