credentials_manager 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf9c615616ed13cbd0bcb3341b1e0c3ea1520d32
4
- data.tar.gz: d07755477982b065cf4edda6e55c53153257b29d
3
+ metadata.gz: 95fb4f6a1877c585fb24e661c51cbaed9e3cf159
4
+ data.tar.gz: dbab8057fcaaab0ede83680f260e94863a5375fd
5
5
  SHA512:
6
- metadata.gz: dac643d433c054b2fe58ebf92fd662f1c5f101ab717db2d8705a25382d7673c7efc8eae32f1fcfbe5aa3b6a5f7de3d3d940f25f8272d2f07a13c4ef94c19a5cd
7
- data.tar.gz: 2822fed6842409dc774f64b201cd4d1261ebfd0c12c3f222c70b7f0b82f9d0ae3834f920956f6cfed626b71887705c7cf039c022ff625233c74b83b90e34fab6
6
+ metadata.gz: bfe02d78ec9b5712e38dd598f731ed1c2e6e96e04476e7eddd9f958cafe6e57d1b14028371a8e0df27314160784b92583e5a0a352b48d74cc73673e90993e3bf
7
+ data.tar.gz: 0ee3e7f8370c8783c3eeefbe374e28cc92063f7b38fda07b5a9c0df074a865ce880babf23987aa5134df71559ba036ee1fbb52676aed536a3761b25dfd7f0366
data/README.md CHANGED
@@ -16,6 +16,8 @@ DELIVER_USER
16
16
  DELIVER_PASSWORD
17
17
  ```
18
18
 
19
+ If you don't want to have your password stored in the Keychain use `FASTLANE_DONT_STORE_PASSWORD`.
20
+
19
21
  ## Implementing a custom solution
20
22
 
21
23
  All ```fastlane``` tools are Ruby-based, and you can take a look at the source code to easily implement your own authentication solution.
@@ -15,8 +15,9 @@ module CredentialsManager
15
15
 
16
16
  # A singleton object, which also makes sure, to use the correct Apple ID
17
17
  # @param id_to_use (String) The Apple ID email address which should be used
18
- def self.shared_manager(id_to_use = nil)
19
- @@instance ||= PasswordManager.new(id_to_use)
18
+ # @param ask_if_missing (boolean) true by default: if no credentials are found, should the user be asked?
19
+ def self.shared_manager(id_to_use = nil, ask_if_missing = true)
20
+ @@instance ||= PasswordManager.new(id_to_use, ask_if_missing)
20
21
  end
21
22
 
22
23
  def self.logout
@@ -27,18 +28,21 @@ module CredentialsManager
27
28
  #
28
29
  # This already check the Keychain if there is a username and password stored.
29
30
  # If that's not the case, it will ask for login data via stdin
30
- # @param id_to_use (String) Apple ID (e.g. steve@apple.com) which should be used for this upload.
31
+ # @param id_to_use (String) Apple ID (e.g. user@apple.com) which should be used for this upload.
31
32
  # if given, only the password will be asked/loaded.
32
- def initialize(id_to_use = nil)
33
+ # @param ask_if_missing (boolean) true by default: if no credentials are found, should the user be asked?
34
+ def initialize(id_to_use = nil, ask_if_missing = true)
33
35
 
34
36
  self.username ||= id_to_use || ENV["DELIVER_USER"] || AppfileConfig.try_fetch_value(:apple_id) || load_from_keychain[0]
35
37
  self.password ||= ENV["DELIVER_PASSWORD"] || load_from_keychain[1]
36
38
 
37
39
  if (self.username || '').length == 0 or (self.password || '').length == 0
38
- puts "No username or password given. You can set environment variables:"
39
- puts "DELIVER_USER, DELIVER_PASSWORD"
40
+ if ask_if_missing
41
+ puts "No username or password given. You can set environment variables:"
42
+ puts "DELIVER_USER, DELIVER_PASSWORD"
40
43
 
41
- ask_for_login
44
+ ask_for_login
45
+ end
42
46
  end
43
47
  end
44
48
 
@@ -64,7 +68,7 @@ module CredentialsManager
64
68
  def ask_for_login
65
69
  puts "-------------------------------------------------------------------------------------".green
66
70
  puts "The login information you enter will be stored in your Mac OS Keychain".green
67
- puts "More information about that on GitHub: https://github.com/KrauseFx/CredentialsManager".green
71
+ puts "More information about that on GitHub: https://github.com/fastlane/CredentialsManager".green
68
72
  puts "-------------------------------------------------------------------------------------".green
69
73
 
70
74
  username_was_there = self.username
@@ -1,3 +1,3 @@
1
1
  module CredentialsManager
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credentials_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-03 00:00:00.000000000 Z
11
+ date: 2015-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline