fastlane-plugin-secrets 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1952c89329b1108e7ecd812bddb25a9b039b030f3dc8e49ab5ac57bf4ee6f899
4
- data.tar.gz: 46ab9387e2830cc420dd234b502633d5d27afeaee6bf8cb5be78e26a5201d79f
3
+ metadata.gz: 5e119ccc8869a15f290077ee25663987f0285c76f04d691428c18530fb02cb2a
4
+ data.tar.gz: 2d31dd31ade39fa3c89a29bf5cf75621567ad883584665029952ca4157bca74b
5
5
  SHA512:
6
- metadata.gz: 868cef63f20765b9ac8cd1ce1fbd74a4abc86d7c760109909db1256ed461d5ad627fc0d895a4ca36465d6613194d274767a31ae33776bd0938dff7a228234ba3
7
- data.tar.gz: ccc1c623e80e0d58cf678729943d69c5c78e30dcff792abc8f715833cc82f87a8319a2e5996e1aae28d30be2511dd9b955bd2650cc169d7b26f134df0d55a262
6
+ metadata.gz: 5d98202e586b4620e2ca1c1e905b85f885924cb076f31c93f57774dd15c317eeaa4c6a71bc52d3997e5edb4f67ac9feb259ced63fbe112e85499f8488fb490a0
7
+ data.tar.gz: ebd0b2a9646314344c24cf1c71c4911f530b0b13546dd5e710687f081e787c4f5b8b74fb2be0e3edfe9349f3f29d6136442e5d0d7b8785786706bceac540f40f
@@ -26,8 +26,10 @@ module Fastlane
26
26
  end
27
27
 
28
28
  yml_config = File.read tmp_decrypted_secrets_file
29
- bytes = secrets_handler.process_yaml_config yml_config
30
- secrets_handler.inject_secrets bytes, target_path
29
+ file_names_bytes, secrets_bytes = secrets_handler.process_yaml_config yml_config
30
+ renderer = MobileSecrets::SourceRenderer.new "swift"
31
+ renderer.render_template secrets_bytes, file_names_bytes, target_path
32
+
31
33
  clean tmp_decrypted_secrets_file
32
34
  end
33
35
 
@@ -11,7 +11,8 @@ module Fastlane
11
11
  secrets_dir_path = params[:secrets_dir_path]
12
12
  secrets_dict = params[:secrets]
13
13
  files = params[:files]
14
- config_yml = {"MobileSecrets" => {"hashKey"=>hash_key,"language"=>language, "secrets"=>secrets_dict, "files"=>files}}.to_yaml
14
+ includes_password = params[:should_include_password]
15
+ config_yml = {"MobileSecrets" => {"hashKey"=>hash_key,"language"=>language, "shouldIncludePassword"=>includes_password, "secrets"=>secrets_dict, "files"=>files}}.to_yaml
15
16
 
16
17
  MobileSecrets::SecretsHandler.new.encrypt "#{secrets_dir_path}/secrets.gpg", config_yml, secrets_dir_path
17
18
  end
@@ -36,7 +37,7 @@ module Fastlane
36
37
  def self.available_options
37
38
  [
38
39
  FastlaneCore::ConfigItem.new(key: :hash_key,
39
- description: "Key that will be used to hash the secrets using XOR technique and encrypt files with AES. If files are encrypted the password must have 32 characters as an AES standard.",
40
+ description: "Key that will be used to hash the secrets using XOR technique and encrypt files with AES, if files are encrypted the password must have 32 characters as an AES standard",
40
41
  is_string: true),
41
42
  FastlaneCore::ConfigItem.new(key: :language,
42
43
  description: "Source code language, currently supported - [swift]",
@@ -44,6 +45,10 @@ module Fastlane
44
45
  FastlaneCore::ConfigItem.new(key: :secrets_dir_path,
45
46
  description: "Path to a directory where .gpg was initialized",
46
47
  is_string: true),
48
+ FastlaneCore::ConfigItem.new(key: :should_include_password,
49
+ description: "Defines whether the password will be added to the output file or whether it will be provided externally",
50
+ type: Boolean,
51
+ optional: false),
47
52
  FastlaneCore::ConfigItem.new(key: :secrets,
48
53
  description: "Key-value dictionary of secrets",
49
54
  type: Hash,
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Secrets
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-secrets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Cermak
@@ -162,7 +162,6 @@ files:
162
162
  - lib/fastlane/plugin/secrets.rb
163
163
  - lib/fastlane/plugin/secrets/actions/decrypt_secrets_action.rb
164
164
  - lib/fastlane/plugin/secrets/actions/encrypt_secrets_action.rb
165
- - lib/fastlane/plugin/secrets/helper/SecretsTemplate.swift
166
165
  - lib/fastlane/plugin/secrets/helper/secrets_helper.rb
167
166
  - lib/fastlane/plugin/secrets/version.rb
168
167
  homepage: https://github.com/cyrilcermak/fastlane-plugin-secrets
@@ -1,28 +0,0 @@
1
- //
2
- // Autogenerated file by Fastlane-Plugin-Secret
3
- //
4
-
5
- import Foundation
6
-
7
- class Secrets {
8
- static let standard = Secrets()
9
- /* SECRET BYTES */
10
-
11
- private init() {}
12
-
13
- func string(forKey key: String) -> String? {
14
- guard let index = bytes.index(where: { String(data: Data(bytes:$0), encoding: .utf8) == key }),
15
- let value = decrypt(bytes[index + 1]) else { return nil }
16
- return String(data: Data(bytes: value), encoding: .utf8)
17
- }
18
-
19
- private func decrypt(_ input: [UInt8]) -> [UInt8]? {
20
- let key = bytes[0]
21
- guard !key.isEmpty else { return nil }
22
- var output = [UInt8]()
23
- for byte in input.enumerated() {
24
- output.append(byte.element ^ key[byte.offset % key.count])
25
- }
26
- return output
27
- }
28
- }