Skip to content

Commit

Permalink
HDDS-10460. Refine audit logging for bucket property updation operations
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvipenumudy committed Mar 5, 2024
1 parent 11c5eb8 commit 3ac648f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ private OzoneConsts() {
public static final String USED_NAMESPACE = "usedNamespace";
public static final String QUOTA_IN_BYTES = "quotaInBytes";
public static final String QUOTA_IN_NAMESPACE = "quotaInNamespace";
public static final String BUCKET_ENCRYPTION_KEY_NAME = "bekName";
public static final String OBJECT_ID = "objectID";
public static final String UPDATE_ID = "updateID";
public static final String CLIENT_ID = "clientID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ public Map<String, String> toAuditMap() {
if (this.ownerName != null) {
auditMap.put(OzoneConsts.OWNER, this.ownerName);
}
if (this.quotaInBytesSet && quotaInBytes > 0 ||
!(this.quotaInBytes == OzoneConsts.QUOTA_RESET)) {
auditMap.put(OzoneConsts.QUOTA_IN_BYTES,
String.valueOf(this.quotaInBytes));
}
if (this.quotaInNamespaceSet && quotaInNamespace > 0 ||
!(this.quotaInNamespace == OzoneConsts.QUOTA_RESET)) {
auditMap.put(OzoneConsts.QUOTA_IN_NAMESPACE,
String.valueOf(this.quotaInNamespace));
}
if (this.bekInfo != null) {
auditMap.put(OzoneConsts.BUCKET_ENCRYPTION_KEY_NAME,
this.bekInfo.getKeyName());
}
if (this.defaultReplicationConfig != null) {
auditMap.put(OzoneConsts.REPLICATION_TYPE, String.valueOf(
this.defaultReplicationConfig.getType()));
auditMap.put(OzoneConsts.REPLICATION_FACTOR,
this.defaultReplicationConfig.getReplicationConfig()
.getReplication());
}
return auditMap;
}

Expand Down

0 comments on commit 3ac648f

Please sign in to comment.