-
Notifications
You must be signed in to change notification settings - Fork 6
New MCP tool for retrieving user audit trails from Harness #16
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
base: master
Are you sure you want to change the base?
Conversation
Updated the function identifier.
Updated function identifier.
client/audit.go
Outdated
} | ||
|
||
params := make(map[string]string) | ||
params["routingId"] = scope.AccountID |
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.
its best to standardize routingId, accountIdentifier etc as consts across all clients
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.
Following the other code files, I've kept this separate in the audit file.
client/audit.go
Outdated
addScope(scope, params) | ||
|
||
// Required fields | ||
opts.FilterType = "Audit" |
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.
what purpose does this filtertype serve ?
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.
That was a field as mentioned in the API Documentation.
client/dto/audit.go
Outdated
FilterType string `json:"filterType,omitempty"` | ||
StartTime int64 `json:"startTime,omitempty"` | ||
EndTime int64 `json:"endTime,omitempty"` | ||
Modules []string `json:"modules,omitempty"` |
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.
Please make sure to match terminology in UI . e.g. Modules is not clear to end user
Indent properly
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 have removed that since post-filtering is being done.
client/dto/audit.go
Outdated
|
||
type AuditListItem struct { | ||
AuditID string `json:"auditId,omitempty"` | ||
InsertId string `json:"insertId,omitempty"` |
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.
what is insertId ?
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.
This entire struct has been removed.
pkg/harness/audit.go
Outdated
maxSize = 100 | ||
) | ||
|
||
func maxMin(val, min, max int) int { |
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.
see if math package can solve your requirements
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 have used the math package to clamp the values.
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.
We need to review this
This PR adds a new MCP tool for retrieving user audit trails from Harness
Features
Required Parameters
Optional Parameters
Testing