-
Notifications
You must be signed in to change notification settings - Fork 10
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
Kqueen ldap #52
Kqueen ldap #52
Conversation
naumvd95
commented
Apr 4, 2018
- refactor env-vars arch to provide configuration using only docker env-vars
- remove apply_env changes due issues with bad overriding in case of multiple value-entries in config file
- logging increased
kqueen_ui/config/auth.py
Outdated
from kqueen_ui.config import current_config | ||
|
||
|
||
class AuthModules(): |
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.
Is there a reason to create this class?
kqueen_ui/config/utils.py
Outdated
""" | ||
|
||
for name, value in os.environ.items(): | ||
if name.startswith(prefix): | ||
config_key_name = name[len(prefix):] | ||
if re.search('(?i)true|(?i)false', value): |
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.
If we are converting strings to bool, can't we convert json string to list/dict in python and avoid creating unnecessary class?
90971bb
to
06cf7a5
Compare
@@ -27,7 +27,7 @@ jobs: | |||
- pip3 install --editable . | |||
- kqueen-ui & | |||
- sleep 2 | |||
- wget -O - http://localhost:8000/ | |||
- wget -O - http://localhost:5080/ |
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.
Is this change connected with ldap changes?
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.
its needed to pass tests
@@ -169,7 +170,10 @@ class MemberCreate(KQueenView): | |||
|
|||
def handle(self, organization_id): | |||
form_cls = MemberCreateForm | |||
auth_options = app.config.get('AUTH_OPTIONS', {}) | |||
|
|||
auth_options = AUTH_MODULES |
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.
this is misleading, you can use AUTH_MODULES directly
kqueen_ui/config/base.py
Outdated
@@ -56,6 +57,8 @@ class BaseConfig: | |||
PROVISIONER_UNKNOWN_STATE = 'Not Reachable' | |||
|
|||
# Authentication choices | |||
LDAP_AUTH_NOTIFY = False | |||
LOCAL_AUTH_NOTIFY = True | |||
AUTH_OPTIONS = {} |
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.
we don't have AUTH_OPTIONS anymore as I understand correctly
kqueen_ui/config/test.py
Outdated
@@ -2,27 +2,23 @@ | |||
|
|||
|
|||
class Config(BaseConfig): | |||
DEBUG = True | |||
DEBUG = False |
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.
Are you sure you want to set it to False?
bcfd4ea
to
fe41a4c
Compare
This change is not equivalent to the current configuration. When you move the auth dict sample from config to code, you can no longer use local auth only for example. Can you alter the code so it is still configurable which auth backends we use? |
kqueen_ui/blueprints/ui/views.py
Outdated
auth_options = app.config.get('AUTH_OPTIONS', {}) | ||
if auth_options: | ||
|
||
if AUTH_MODULES: |
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.
you are imported it directly, this check is redundant
@@ -56,7 +57,8 @@ class BaseConfig: | |||
PROVISIONER_UNKNOWN_STATE = 'Not Reachable' | |||
|
|||
# Authentication choices | |||
AUTH_OPTIONS = {} | |||
LDAP_AUTH_NOTIFY = False |
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.
In the rest of the file boolean variables are strings, let's keep consistent and dot he same for those paramaters
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.
in my opinion it redundant, those variables should be bool ideally
in docker env bool vars is not allowed in compose file docker/compose#2000
so imo docker-env and config files should not be equal
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.
IMO one way we should avoid quotes - is defining all docker vars into '.env' file. There is allowed to use normal bool vars, but it is another PR, does not related to this case
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.
ok, so need to fix ENABLE_PUBLIC_REGISTRATION = 'False' in that file in a separate change
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.
ok, so pls approve changes @atengler @katyafervent
# Auth configuration | ||
|
||
# Enable email notifications to user | ||
LDAP_AUTH_NOTIFY = False |
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.
same as above
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.
in my opinion it redundant, those variables should be bool ideally
in docker env bool vars is not allowed in compose file docker/compose#2000
so imo docker-env and config files should not be equal
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.
IMO one way we should avoid quotes - is defining all docker vars into '.env' file. There is allowed to use normal bool vars, but it is another PR, does not related to this case
- refactor arch for Auth modules management
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.
LGTM, but I suggest to use one style for commit messages - with the capital letter
- configuration file parsing refactores to increase visibility and decrease cyclomatic complexity - bool-checker added to avoid issues with defining bool variables as string in docker-compose
@atengler pls clarify info about auth_config, i don't understand what do u mean |