Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Auditing group members as part of group resource#5730

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 12 commits intomainfromaudit-group-and-members/kira-pilot
Jan 18, 2023

Conversation

Kira-Pilot
Copy link
Member

@Kira-PilotKira-Pilot commentedJan 16, 2023
edited
Loading

resolves#4736

We now audit group members as part of group changes:
Screen Shot 2023-01-17 at 2 58 07 PM

@Kira-PilotKira-Pilot changed the titleadded AuditableGroup typefeat: Auditing group members as part of group resourceJan 17, 2023
@Kira-PilotKira-Pilot marked this pull request as ready for reviewJanuary 17, 2023 20:14
@Kira-PilotKira-Pilot requested a review froma team as acode ownerJanuary 17, 2023 20:14
@Kira-PilotKira-Pilot requested review frompresleyp,Emyrk andcoadler and removed request fora teamJanuary 17, 2023 20:14
Audit: *auditor,
Log: api.Logger,
Request: r,
Action: database.AuditActionDelete,
})
)
defer commitAudit()
aReq.Old = group
var emptyUsers []database.User
aReq.Old = group.Auditable(emptyUsers)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't theaReq.New beemptyUsers and theaReq.Old have the members?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Great catch@Emyrk! Updated.

Kira-Pilotand others added4 commitsJanuary 17, 2023 16:10
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
…/coder into audit-group-and-members/kira-pilot
Comment on lines 245 to 246
patchedMembers, patchedMembersErr := api.Database.GetGroupMembers(ctx, group.ID)
ifpatchedMembersErr != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these errors need to be named differently? It seems like the wrong error is being passed below.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oops! Will fix. What convention do you like for naming errors? Just call themerr until there's a scoping conflict?

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you need multiple errors in scope at once, I would always just name themerr!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sounds good! Will update now.

// groups have nested diffs (group members)
// so we overwrite the member diff such that
// only the user_id is shown.
if (auditLog.resource_type === "group") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you pull this out into a util function, maybe with a unit test?

Kira-Pilot reacted with thumbs up emoji
@Kira-PilotKira-Pilot merged commit6b68fbb intomainJan 18, 2023
@Kira-PilotKira-Pilot deleted the audit-group-and-members/kira-pilot branchJanuary 18, 2023 20:13
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 18, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk left review comments

@coadlercoadlercoadler approved these changes

@kylecarbskylecarbskylecarbs left review comments

@presleyppresleyppresleyp approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

audit: updating users in a group should generate an audit log diff
5 participants
@Kira-Pilot@presleyp@Emyrk@coadler@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp