Skip to content

feat: Add audit log filters #4078

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

Merged
merged 11 commits into from
Sep 19, 2022
Merged

feat: Add audit log filters #4078

merged 11 commits into from
Sep 19, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma commented Sep 15, 2022

The back-end part of #4077

@BrunoQuaresma BrunoQuaresma requested review from coadler and a team September 15, 2022 18:21
@BrunoQuaresma BrunoQuaresma self-assigned this Sep 15, 2022
@BrunoQuaresma
Copy link
Collaborator Author

Opening to receiving initial feedback on the API side.

Comment on lines +119 to +123
var params []string
if req.SearchQuery != "" {
params = append(params, req.SearchQuery)
}
q.Set("q", strings.Join(params, " "))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly confused with params. It seems like it can only ever have 0 or 1 elements. Why do we need to strings.Join it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I copied and paste from the workspace logic.

Copy link
Collaborator Author

@BrunoQuaresma BrunoQuaresma Sep 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking better, it could have resource_type:workspace action:create right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where we're defining the name of the param? Do we have control over calling it q or something else?

@BrunoQuaresma BrunoQuaresma marked this pull request as ready for review September 16, 2022 19:12
@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner September 16, 2022 19:12
@BrunoQuaresma BrunoQuaresma requested review from jsjoeio and removed request for a team September 16, 2022 19:12
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +119 to +123
var params []string
if req.SearchQuery != "" {
params = append(params, req.SearchQuery)
}
q.Set("q", strings.Join(params, " "))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where we're defining the name of the param? Do we have control over calling it q or something else?

Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good! One of the most important actions will be viewing logs by resource ID, so I hope we're adding it.

@BrunoQuaresma BrunoQuaresma merged commit bf8d823 into main Sep 19, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/add-filter-to-audit-logs branch September 19, 2022 13:37
@BrunoQuaresma
Copy link
Collaborator Author

@kylecarbs how would you expect to use the "Resource ID" in the filtering? Just a text input? 🤔 wondering if we could provide a better experience.

@kylecarbs
Copy link
Member

I'd do it with a filter, similar to this PR.

resource-id:xxxxxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants