-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from wangyu096/issue_22
feature: 审计事件支持上报 scope_type 和 scope_id #22
- Loading branch information
Showing
30 changed files
with
540 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
bk-audit-java-sdk/src/main/java/com/tencent/bk/audit/filter/AuditPostFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.tencent.bk.audit.filter; | ||
|
||
import com.tencent.bk.audit.model.AuditEvent; | ||
|
||
/** | ||
* 审计结束之前触发的 Filter,允许修改最终的审计事件。 | ||
*/ | ||
public interface AuditPostFilter { | ||
/** | ||
* 修改审计事件 | ||
* | ||
* @param auditEvent 审计事件 | ||
* @return 修改之后的审计事件 | ||
*/ | ||
default AuditEvent map(AuditEvent auditEvent) { | ||
return auditEvent; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
bk-audit-java-sdk/src/main/java/com/tencent/bk/audit/filter/AuditPostFilters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.tencent.bk.audit.filter; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* AuditPostFilter 管理 | ||
*/ | ||
@Slf4j | ||
public class AuditPostFilters { | ||
private static final List<AuditPostFilter> filters = new ArrayList<>(); | ||
|
||
public static void addFilter(AuditPostFilter filter) { | ||
log.info("Add AuditPostFilter: {}", filter); | ||
filters.add(filter); | ||
} | ||
|
||
public static List<AuditPostFilter> getFilters() { | ||
return filters; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.