pad_sec 0.1.0 → 0.2.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 +4 -4
- data/lib/pad_sec.rb +20 -1
- data/lib/pad_sec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dd736baa5051a20e5c9185a1a3e8639ac0667b3
|
4
|
+
data.tar.gz: ce915f22ce0e6f41728d9499389ac0ce7c034d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e38097816efd3cb42f15d4affb92093edfcc6795c1aa777d19ca7b1248ede4b2fdd95cb19b8c9b18dbcef12c243806c1a72126905ae8388fb01e0efa715d74b
|
7
|
+
data.tar.gz: fefb51f0621729a33a52f40ed927f6fc8881d8b80bf79790153ca5ee1498741480e4a8bbf40937e1c405ecca02e33eebe1e53aa72c918b4f390589462c482907
|
data/lib/pad_sec.rb
CHANGED
@@ -46,6 +46,25 @@ module PadSec
|
|
46
46
|
authenticate
|
47
47
|
end
|
48
48
|
|
49
|
+
|
50
|
+
# Gets the current token.
|
51
|
+
#
|
52
|
+
# @return [String, Void] token or nil
|
53
|
+
def self.get_token
|
54
|
+
token = nil
|
55
|
+
config_file = PadSec::ConfigFile::path
|
56
|
+
|
57
|
+
if PadUtils.file_exist?(config_file)
|
58
|
+
config = PadUtils.json_file_to_hash(config_file)
|
59
|
+
if !config[:token].nil?
|
60
|
+
token = config[:token]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
token
|
65
|
+
|
66
|
+
end
|
67
|
+
|
49
68
|
private
|
50
69
|
|
51
70
|
|
@@ -110,7 +129,7 @@ module PadSec
|
|
110
129
|
# Tries to authenticate with a username and password.
|
111
130
|
#
|
112
131
|
# @param username [String]
|
113
|
-
# @param
|
132
|
+
# @param pwd [String]
|
114
133
|
# @return [Boolean]
|
115
134
|
# @example
|
116
135
|
# PadSec.authenticate_with_username(username: "Bob", pwd: "1234") # => true
|
data/lib/pad_sec/version.rb
CHANGED