Skip to content

V2 for release 2.4 #443

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 5 commits into from
Feb 6, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions user_sync/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ def get_directory_connector_options(self, connector_name):
"""
options = {}
connectors_config = self.get_directory_connector_configs()

if ( 'okta' in connectors_config.value) and (connector_name == 'ldap'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now that I've had more time to look at this, I think we need to make this check more generic. If you do the opposite of what we're checking here - enable the link to the Okta config, but make sure the --connector is "ldap" - then we still get an unhelpful message.

The check should ensure that the correct config file is specified for the connector type. The only exception is CSV, which does not require a configuration file.

Here is how I would modify your check:

if connector_name != 'csv' and connector_name not in connectors_config.value:
  # ... rest of check

You will also need to change the error message - I'll address that separately.

if connectors_config.accessed_keys is not None:
raise AssertionException("Failed to match request : for Okta Connector type receiving LDAP as input type from commnand line")
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you make the check more generic you'll need to make this message generic as well. I'd do something like this:

raise AssertionException("Config file must be specified for connector type '{}'".format(connector_name))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

modified. please review


if connectors_config is not None:
connector_item = connectors_config.get_list(connector_name, True)
options = self.get_dict_from_sources(connector_item)
Expand Down