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

Change enable to "enable=" #5104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

taran-p
Copy link
Contributor

@taran-p taran-p commented Jan 6, 2025

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

Change mc idp ldap/openid enable to change config file to "enable=" rather than "enable=on"

If configuration is returned by mc idp ldap/openid info but enable is missing, print that enable is on since that is the default.

Motivation and Context

Currently if LDAP or OpenID is configured through environment variables, it is possible to disable the config but not possible to reenable.

miniohq/eos#276

How to test this PR?

Configure LDAP or OpenID using environment variables, disable the config, then enable it. This fails previously, now succeeds.

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

@taran-p
Copy link
Contributor Author

taran-p commented Jan 6, 2025

@harshavardhana @vadmeste Not sure if this is the "right" way to do this, but it's simple and works. The issue stems from the fact that enable/disable simply edits the configuration file, and that editing process checks the validity of the config in the file but not env variables. This fix works because enable is on by default as long as there is a valid configuration. If this isn't the appropriate way to fix this, I can explore other options.

@harshavardhana
Copy link
Member

@harshavardhana @vadmeste Not sure if this is the "right" way to do this, but it's simple and works. The issue stems from the fact that enable/disable simply edits the configuration file, and that editing process checks the validity of the config in the file but not env variables. This fix works because enable is on by default as long as there is a valid configuration. If this isn't the appropriate way to fix this, I can explore other options.

You don't need enable=on, in SetKV it is expected default when you are setting it, when not specified.

enable=off is needed when you want to turn it off explicitly.

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