-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add swagger api and audit_log_ext table model #21360
base: main
Are you sure you want to change the base?
Conversation
7f20970
to
3e8f55d
Compare
add auditlog-ext related api in swagger add audit_log_ext table Signed-off-by: stonezdj <[email protected]>
3e8f55d
to
59ae032
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #21360 +/- ##
==========================================
+ Coverage 45.36% 46.18% +0.81%
==========================================
Files 244 247 +3
Lines 13333 13883 +550
Branches 2719 2875 +156
==========================================
+ Hits 6049 6412 +363
- Misses 6983 7134 +151
- Partials 301 337 +36
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -1755,6 +1755,59 @@ paths: | |||
$ref: '#/responses/401' | |||
'500': | |||
$ref: '#/responses/500' | |||
/auditlog-exts: | |||
get: | |||
summary: Get recent logs of the projects which the user is a member of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- As per the design the user has to be a project admin to see the audit log of a project.
- I don't really think we need to provide a aggregated view of audit log of different projects. How about we use this API only for system admin?
@@ -1755,6 +1755,59 @@ paths: | |||
$ref: '#/responses/401' | |||
'500': | |||
$ref: '#/responses/500' | |||
/auditlog-exts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: IMO it should be auditlogs-ext
, if you agree, please also update the code and other resources.
@@ -1789,6 +1842,40 @@ paths: | |||
$ref: '#/responses/401' | |||
'500': | |||
$ref: '#/responses/500' | |||
/projects/{project_name}/log-exts: | |||
get: | |||
summary: Get recent logs of the projects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add some words to differentiate from the old API /projects/{project_name}/logs
.
Maybe also updating the description of the old API to explicitly mention it's only for old data and will be deprecated?
$ref: '#/responses/401' | ||
'500': | ||
$ref: '#/responses/500' | ||
/auditlog-exts/eventtypes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have to be a subresource of auditlog? How about /auditlog-eventtypes
?
Shall we also mention the security requirements in the API description? I believe only system admin can use this API?
@@ -1789,6 +1842,40 @@ paths: | |||
$ref: '#/responses/401' | |||
'500': | |||
$ref: '#/responses/500' | |||
/projects/{project_name}/log-exts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes it's auditlog-ext
but sometimes it's log-ext
. Is there a reason for this inconsistency?
AuditLogEventType: | ||
type: object | ||
properties: | ||
event_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also commented in the design, it seems there's a dup between event_id
and name
if we wanna set the value create_user
for event_id and Create user
for name.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #(issue)
Please indicate you've done the following: