Skip to content

[management] Delete service users with account manager #3793

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 2 commits into from
May 6, 2025

Conversation

bcmmbaga
Copy link
Contributor

@bcmmbaga bcmmbaga commented May 6, 2025

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@Copilot Copilot AI review requested due to automatic review settings May 6, 2025 14:44
Copy link

sonarqubecloud bot commented May 6, 2025

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the account deletion logic within the management service to ensure that service users are properly deleted while preserving the authenticated user's account. Key changes include:

  • Updating the deletion loop in DeleteAccount to first skip the authenticated user.
  • Adding deletion calls for service users other than the authenticated user.
  • Extending tests in account_test.go to check that personal access tokens are removed for service users.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
management/server/account_test.go Adds test users (service-user-1 and service-user-2) and verifies that PATs are removed following account deletion.
management/server/account.go Refactors the user iteration logic in DeleteAccount to ensure the appropriate service users are deleted.

@pascal-fischer pascal-fischer merged commit ebda0fc into main May 6, 2025
35 checks passed
@pascal-fischer pascal-fischer deleted the service-user-delete branch May 6, 2025 15:31
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.

2 participants