spaceship/lib/spaceship/connect_api/token.rb in fastlane-2.183.2 vs spaceship/lib/spaceship/connect_api/token.rb in fastlane-2.184.0
- old
+ new
@@ -23,9 +23,15 @@
# Temporary attribute not needed to create the JWT text
# There is no way to determine if the team associated with this
# key is for App Store or Enterprise so this is the temporary workaround
attr_accessor :in_house
+ def self.from(hash: nil, filepath: nil)
+ api_token ||= self.create(**hash) if hash
+ api_token ||= self.from_json_file(filepath) if filepath
+ return api_token
+ end
+
def self.from_json_file(filepath)
json = JSON.parse(File.read(filepath), { symbolize_names: true })
missing_keys = []
missing_keys << 'key_id' unless json.key?(:key_id)