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

Hide sensitive information in match output #21603

Merged
merged 4 commits into from Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion fastlane_core/lib/fastlane_core/cert_checker.rb
Expand Up @@ -116,7 +116,7 @@ def self.installed_wwdr_certificates

# Find all installed WWDRCA certificates
installed_certs = []
Helper.backticks("security find-certificate -a -c '#{certificate_name}' -p #{wwdr_keychain.shellescape}")
Helper.backticks("security find-certificate -a -c '#{certificate_name}' -p #{wwdr_keychain.shellescape}", print: false)
.lines
.each do |line|
if line.start_with?('-----BEGIN CERTIFICATE-----')
Expand Down
6 changes: 3 additions & 3 deletions fastlane_core/spec/cert_checker_spec.rb
Expand Up @@ -40,7 +40,7 @@ class ProcessStatusMock
it "should return installed certificate's alias" do
expect(FastlaneCore::CertChecker).to receive(:wwdr_keychain).and_return('login.keychain')

allow(FastlaneCore::Helper).to receive(:backticks).with(/security find-certificate/).and_return("-----BEGIN CERTIFICATE-----\nG6\n-----END CERTIFICATE-----\n")
allow(FastlaneCore::Helper).to receive(:backticks).with(/security find-certificate/, { print: false }).and_return("-----BEGIN CERTIFICATE-----\nG6\n-----END CERTIFICATE-----\n")

allow(Digest::SHA256).to receive(:hexdigest).with(cert.to_der).and_return('bdd4ed6e74691f0c2bfd01be0296197af1379e0418e2d300efa9c3bef642ca30')
allow(OpenSSL::X509::Certificate).to receive(:new).and_return(cert)
Expand All @@ -51,7 +51,7 @@ class ProcessStatusMock
it "should return an empty array if unknown WWDR certificates are found" do
expect(FastlaneCore::CertChecker).to receive(:wwdr_keychain).and_return('login.keychain')

allow(FastlaneCore::Helper).to receive(:backticks).with(/security find-certificate/).and_return("-----BEGIN CERTIFICATE-----\nG6\n-----END CERTIFICATE-----\n")
allow(FastlaneCore::Helper).to receive(:backticks).with(/security find-certificate/, { print: false }).and_return("-----BEGIN CERTIFICATE-----\nG6\n-----END CERTIFICATE-----\n")

allow(OpenSSL::X509::Certificate).to receive(:new).and_return(cert)

Expand Down Expand Up @@ -103,7 +103,7 @@ class ProcessStatusMock

it 'should shell escape keychain names when checking for installation' do
expect(FastlaneCore::CertChecker).to receive(:wwdr_keychain).and_return(keychain_name)
expect(FastlaneCore::Helper).to receive(:backticks).with(name_regex).and_return("")
expect(FastlaneCore::Helper).to receive(:backticks).with(name_regex, { print: false }).and_return("")

FastlaneCore::CertChecker.installed_wwdr_certificates
end
Expand Down