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

intermediate work on #159 #172

Merged
merged 4 commits into from
May 2, 2017
Merged

intermediate work on #159 #172

merged 4 commits into from
May 2, 2017

Conversation

adobeDan
Copy link
Contributor

@adobeDan adobeDan commented Apr 29, 2017

The work on #159 will be in two pieces:

  • allowing sensitive data (passwords, client secrets, private key data, etc.) to be stored in the platform's native credential manager; and
  • allowing the use of an external process to retrieve configuration files directly into process memory, removing the need to store any sensitive configuration data local to the machine.

This PR is for the first bullet. It removes the notion of an external credential manager class and instead integrates the use of keyring directly into the directory connectors. It also cleans up a lot of PEP8 style violations and puts a bunch of extra parens in if statements and rewrites None comparisons into their correct form.

I am submitting this PR to get some code review in advance of the second change, but in addition I wanted to let @phil-levy get started on the documentation. So I have emailed an encrypted ZIP file to all reviewers (as well as the password) that has configuration files with live (Adobe-internal) credentials in all the different ways you can specify them.

From @bhunut-adobe: adding keyring and using it to get ldap passwords from the Windows credential manager.
* allow specifying private key data in UMAPI config, using `priv_key_data` config setting (requires the YAML `|` convention with indented PEM key data on following lines)
* get LDAP password from keyring, using `secure_password_key` config setting
* get UMAPI client secret from keyring, using `secure_client_secret_key` config setting
* get UMAPI private key data from keyring, using `secure_priv_key_data_key` config setting
* remove the credential manager
* clean up conventions around if parens and None comparisons in config.py
* get rid of all PEP8 style warnings in config.py and the directory modules.
@adobeDan adobeDan requested a review from phil-levy April 29, 2017 18:38
Copy link
Contributor

@phil-levy phil-levy left a comment

Choose a reason for hiding this comment

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

I think api_key should be considered a secure value for umapi access also.

adobeDan added 2 commits May 1, 2017 18:31
* Add get_credential accessor to DictConfig, and integrate all use of keyring there.
* Refactor ldap and umapi connectors to use get_credential.
* move to consistent naming of connector configs.
* catch a duplicated function definition in umapi connector.
* added a counter to the excluded_stray case in rules.py
* while I was there, cleaned up all PEP 8 style warnings (mostly redundant parentheses and better comparisons with None).
* make the umapi api_key setting a credential (a 1-line change, thanks to the refactoring done in my last commit! :)
@adobeDan
Copy link
Contributor Author

adobeDan commented May 2, 2017

I've made api_key into a credential as per review. (Thanks to the refactoring, this was a 1-line change.) I also found and fixed a bug (#173) while I was testing the change. @phil-levy I would appreciate a second review of the later commits.

@adobeDan adobeDan requested a review from phil-levy May 2, 2017 02:11
Copy link
Contributor

@phil-levy phil-levy left a comment

Choose a reason for hiding this comment

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

Looks good. Refactor makes reading much easier.

@adobeDan adobeDan merged commit a5d88f2 into v2 May 2, 2017
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