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

[fastlane_core] fix parsing of passwords with trailing spaces due to wrong whitespace handling in Fastlane::Shell::password method #18684

Merged
merged 1 commit into from
May 13, 2021

Conversation

bliednov
Copy link
Contributor

@bliednov bliednov commented May 12, 2021

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Resolves #18683

Description

The default highline whitespace handling is :strip that simply removes all trailing whitespaces (see the related docs). I changed it to :chomp.

I assume that trailing tabs and spaces should be permitted for passwords.

Testing Steps

The following passwords would fail previously:

  • "password_with_a_space_in_the_end "
  • "password_with_multiple_spaces_in_the_end "
  • "password_with_multiple_spaces_and_tabs_in_the_end \t \t"

In order to test it you can create a keychain with the following command and use one of the passwords from above:

$ security create-keychain ~/Library/Keychains/test.keychain-db

Next, you should use one of the actions that will try to use that keychain:

  1. E.g. by specifying MATCH_KEYCHAIN_NAME=test and running match.
  2. Or e.g. with bundle exec fastlane run get_certificates keychain_path:~/Library/Keychains/test.keychain-db

… handling in Fastlane::Shell::password method
@google-cla google-cla bot added the cla: yes label May 12, 2021
@joshdholtz joshdholtz changed the title Fix parsing of passwords with trailing spaces due to wrong whitespace handling in Fastlane::Shell::password method [fastlane_core] fix parsing of passwords with trailing spaces due to wrong whitespace handling in Fastlane::Shell::password method May 13, 2021
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

This makes sense to me! I don't think this should cause any breaking changes 🤷‍♂️ Really appreciate the contribution ❤️

@joshdholtz joshdholtz merged commit 43a401a into fastlane:master May 13, 2021
@bliednov bliednov deleted the fix-ask-password branch May 14, 2021 15:16
@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.183.0 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

password method from fastlane_core/ui/implementations/shell.rb does not work correctly for specific passwords
3 participants