You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by am...@apache.org on 2021/02/04 21:16:32 UTC
[atlas] branch master updated (7a3f512 -> 960f948)
This is an automated email from the ASF dual-hosted git repository.
amestry pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git.
from 7a3f512 Atlas-4166: UI should not allow the user to create a glossary with blank(" ") name
new 15cd037 ATLAS-4136: Export Service: NPE if Options Explicitly set to NULL
new 960f948 ATLAS-4137 Fix for broken V1 entity audit API
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../converters/AtlasInstanceConverter.java | 2 ++
.../apache/atlas/web/resources/AdminResource.java | 25 +++++++++++++---------
2 files changed, 17 insertions(+), 10 deletions(-)
[atlas] 01/02: ATLAS-4136: Export Service: NPE if Options
Explicitly set to NULL
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amestry pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 15cd0378ef54720349f28ef3f2624f93b4f5b30e
Author: Ashutosh Mestry <am...@cloudera.com>
AuthorDate: Thu Feb 4 09:58:57 2021 -0800
ATLAS-4136: Export Service: NPE if Options Explicitly set to NULL
---
.../apache/atlas/web/resources/AdminResource.java | 25 +++++++++++++---------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index b20b404..e8fc111 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -390,7 +390,7 @@ public class AdminResource {
AtlasAuthorizationUtils.verifyAccess(new AtlasAdminAccessRequest(AtlasPrivilege.ADMIN_EXPORT), "export");
- boolean preventMultipleRequests = request != null
+ boolean preventMultipleRequests = request != null && request.getOptions() != null
&& !(request.getOptions().containsKey(AtlasExportRequest.OPTION_SKIP_LINEAGE)
|| request.getOptions().containsKey(AtlasExportRequest.OPTION_KEY_REPLICATED_TO));
if (preventMultipleRequests) {
@@ -455,7 +455,8 @@ public class AdminResource {
try {
AtlasImportRequest request = AtlasType.fromJson(jsonData, AtlasImportRequest.class);
- preventMultipleRequests = request != null && !request.getOptions().containsKey(AtlasImportRequest.OPTION_KEY_REPLICATED_FROM);
+ preventMultipleRequests = request != null && request.getOptions() != null
+ && !request.getOptions().containsKey(AtlasImportRequest.OPTION_KEY_REPLICATED_FROM);
if (preventMultipleRequests) {
acquireExportImportLock("import");
}
@@ -537,7 +538,8 @@ public class AdminResource {
try {
AtlasImportRequest request = AtlasType.fromJson(jsonData, AtlasImportRequest.class);
- preventMultipleRequests = request != null && request.getOptions().containsKey(AtlasImportRequest.OPTION_KEY_REPLICATED_FROM);
+ preventMultipleRequests = request != null && request.getOptions() != null
+ && request.getOptions().containsKey(AtlasImportRequest.OPTION_KEY_REPLICATED_FROM);
if (preventMultipleRequests) {
acquireExportImportLock("importFile");
@@ -783,16 +785,19 @@ public class AdminResource {
}
private void addToExportOperationAudits(boolean isSuccessful, AtlasExportResult result) throws AtlasBaseException {
- if (isSuccessful && CollectionUtils.isNotEmpty(result.getRequest().getItemsToExport())) {
+ if (!isSuccessful
+ || CollectionUtils.isEmpty(result.getRequest().getItemsToExport())
+ || result.getRequest().getOptions() == null) {
+ return;
+ }
- Map<String, Object> optionMap = result.getRequest().getOptions();
- optionMap.put(OPERATION_STATUS, result.getOperationStatus().name());
- String params = AtlasJson.toJson(optionMap);
+ Map<String, Object> optionMap = result.getRequest().getOptions();
+ optionMap.put(OPERATION_STATUS, result.getOperationStatus().name());
+ String params = AtlasJson.toJson(optionMap);
- List<AtlasObjectId> objectIds = result.getRequest().getItemsToExport();
+ List<AtlasObjectId> objectIds = result.getRequest().getItemsToExport();
- auditImportExportOperations(objectIds, AuditOperation.EXPORT, params);
- }
+ auditImportExportOperations(objectIds, AuditOperation.EXPORT, params);
}
private void auditImportExportOperations(List<AtlasObjectId> objectIds, AuditOperation auditOperation, String params) throws AtlasBaseException {
[atlas] 02/02: ATLAS-4137 Fix for broken V1 entity audit API
Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
amestry pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
commit 960f9481e6914e6591687c13e084a90fec1c2d02
Author: Deep Singh <de...@gmail.com>
AuthorDate: Thu Feb 4 12:13:04 2021 -0600
ATLAS-4137 Fix for broken V1 entity audit API
Signed-off-by: Ashutosh Mestry <am...@cloudera.com>
---
.../org/apache/atlas/repository/converters/AtlasInstanceConverter.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
index 6fc0c65..5c08874 100644
--- a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
+++ b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
@@ -384,6 +384,8 @@ public class AtlasInstanceConverter {
case ENTITY_CREATE:
return EntityAuditEvent.EntityAuditAction.ENTITY_CREATE;
case ENTITY_UPDATE:
+ case BUSINESS_ATTRIBUTE_UPDATE:
+ case CUSTOM_ATTRIBUTE_UPDATE:
return EntityAuditEvent.EntityAuditAction.ENTITY_UPDATE;
case ENTITY_DELETE:
return EntityAuditEvent.EntityAuditAction.ENTITY_DELETE;