-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DSIP-26][Audit log] Audit log improvement design #15423
Comments
@qingwli if user deletes 2 process defintions in a single batch-delete operation, will there be 2 audit records in the table? or just 1 record with 2 objects |
Will record in two lines |
It seems is not compatible with current system, since you need to change the schema in database. |
Yes, I changed the schema, but this table is never used before, just defined with no data |
Search before asking
Motivation
Record user operation logs like create, update, delete, run, and stop jobs, etc. Easy to track item state.
Design Detail
1. Previous Design
#5822
1. Realize Method
#5822 (comment)
Previous design choose public subscribe mode. The reason why is just want to record success operation. And AOP can support this function.
POC:
Publish and subscribe mode has
high code intrusive
, we need toadd log
method anywhere. So we thought AOP it's more better.2. Schema Design
2. Deficiencies
The recorded operation granularity is too rough. Not clear enough to show the level like workflow and project.
1. Classification
Project
Resource
Datasource
Security
2. Extract object
We use mutili level of object like:
Level 1: Project.
Level 2: Workflow.
Level 3: Workflow Instance.
Level 1: Resource.
Level 2: Folder.
Level 3: File.
Demo:
3. Extract operation type
We can extract operation type like :
4. New Schema Design
We have two enum defined AuditObjectType and AuditOperationType
AuditObjectType
ParentType shows the hierarchical relationship used for UI search like we can search all project and the object belongs to the project log.
AuditOperationType
Shows the operator about the object.
AuditType
AuditType is the combo show the operator to the object. All audit type binds a operatorImpl service. requestParamName string array means we need get some information from the request like delete,when this request finished we can not get this object from db, so we need record this id and name before execution, returnObjectFieldName string array means we need get somw information from the return object like after object insert we can get the id.
5.Base operator
All audit type have some common method to record log, like get some information from requestParamName and get some information from returnObjectFieldName. Some common method code in base operator, other special code in other operatorImpl.
3. UI design
Search field:
User
Object Type(Project, Security)
Object Name
Operation Type(Create, Delete, Update)
Database Design
Compatibility, Deprecation, and Migration Plan
Compatible with current system, aspect all api method, but just create, delete, method will into record log logic, other query method will keep same. Just record log not change anything about api request.
Pre design when user request api
Now design
Test Plan
Test locally and pass UT.
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: