-
Notifications
You must be signed in to change notification settings - Fork 356
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
Disable Look up Group for Amazon, Database and External with SAML #3881
Conversation
594969f
to
9b661c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just this one suggestion.
@@ -1,6 +1,9 @@ | |||
- if @edit | |||
- url = url_for_only_path(:action => 'rbac_group_field_changed', :id => (@edit[:group_id] || "new")) | |||
- combo_url = "/ops/rbac_group_field_changed/#{@edit[:group_id] || 'new'}" | |||
- amazon_authentication = ::Settings.authentication.mode.casecmp('amazon') == 0 | |||
- database_authentication = ::Settings.authentication.mode.casecmp('database') == 0 | |||
- ext_auth_with_saml = ::Settings.authentication.mode.casecmp("httpd") == 0 && ::Settings.authentication.saml_enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZitaNemeckova Thank you for putting this together.
I have a suggestion that might simplify the code.
Group lookup is only supported when:
- mode is either ldap or ldaps
- mode is httpd and saml is not enabled
So maybe something like this ruby-ish pseudo code would be better:
mode = ::Settings.authentication.mode
saml_enabled = ::Settings.authentication.saml_enabled
can_lookup_groups = false
can_lookup_groups = mode.downcase.start_with?('ldap')
can_lookup_groups = mode.downcase == "httpd" && ! saml_enabled unless can_lookup_groups
Then the check below changes from:
- if !amazon_authentication && !database_authentication && !ext_auth_with_saml
+ if can_lookup_groups
Hope this helps! JoeV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jvlcek Thanks, looks way better 👍
9b661c0
to
355c99c
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@7f63e7b~...355c99c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
👍 Nice @ZitaNemeckova Thank you. LGTM |
@mzazrivec please review/merge, thanks :) |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1440209
Instructions from BZ:
How to reproduce:
Configuration -> Settings -> select Current Server -> Authentication -> Mode -> set to
Amazon
/Database
/External
withSAML
enabledConfiguration -> Access Control -> Create a new Group
Before:
After:
@miq-bot add_label bug, gaprindashvili/yes, fine/yes, euwe/yes