Skip to content
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

fix: remove policy mapping file when empty #18828

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

donatello
Copy link
Member

Description

On a policy detach operation, if there are no policies remaining attached to the user/group, remove the policy mapping file, instead of leaving a file containing an empty list of policies.

Motivation and Context

With LDAP configured, after detaching all policies on a user, a user listing operation shows user with an empty policy list.

How to test this PR?

  1. Configure LDAP for MinIO
  2. Attach a policy to an LDAP user
  3. Detach the policy from the LDAP user
  4. List users with mc admin user list - it should not show the user from step 2/3.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

On a policy detach operation, if there are no policies remaining
attached to the user/group, remove the policy mapping file, instead of
leaving a file containing an empty list of policies.
Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

Please add a test-case

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

LGTM - but no idea about the functionality.

@harshavardhana harshavardhana merged commit cc960ad into minio:master Jan 19, 2024
20 checks passed
@donatello donatello deleted the fix-policy-detach branch January 19, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants