Sha256: 5cee7e89d5682dc67330086359b11d9ce23fad414cca86b0fd82e2b776c5453b

Contents?: true

Size: 1.71 KB

Versions: 472

Compression:

Stored size: 1.71 KB

Contents

module Fastlane
  module Actions
    class VerifyPodKeysAction < Action
      def self.run(params)
        UI.message("Validating CocoaPods Keys")

        options = plugin_options
        target = options["target"] || ""

        options["keys"].each do |key|
          UI.message(" - #{key}")
          validate(key, target)
        end
      end

      def self.plugin_options
        require 'cocoapods-core'
        podfile = Pod::Podfile.from_file "Podfile"
        podfile.plugins["cocoapods-keys"]
      end

      def self.validate(key, target)
        if value(key, target).length < 2
          message = "Did not pass validation for key #{key}. " \
            "Run `[bundle exec] pod keys get #{key} #{target}` to see what it is. " \
            "It's likely this is running with empty/OSS keys."
          raise message
        end
      end

      def self.value(key, target)
        value = `pod keys get #{key} #{target}`
        value.split("]").last.strip
      end

      def self.author
        "ashfurrow"
      end

      #####################################################
      # @!group Documentation
      #####################################################

      def self.description
        "Verifies all keys referenced from the Podfile are non-empty"
      end

      def self.details
        "Runs a check against all keys specified in your Podfile to make sure they're more than a single character long. This is to ensure you don't deploy with stubbed keys."
      end

      def self.is_supported?(platform)
        [:ios, :mac].include?(platform)
      end

      def self.example_code
        [
          'verify_pod_keys'
        ]
      end

      def self.category
        :building
      end
    end
  end
end

Version data entries

472 entries across 472 versions & 1 rubygems

Version Path
fastlane-2.67.0.beta.20171126010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.67.0.beta.20171125010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.67.0.beta.20171124010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.67.0.beta.20171123010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.67.0.beta.20171122010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.66.2 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.66.1 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.67.0.beta.20171121010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.66.0 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171120010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171119010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171118010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171117010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171116010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171115010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171114010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.64.1 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171113010004 fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane-2.65.0.beta.20171112010003 fastlane/lib/fastlane/actions/verify_pod_keys.rb