tfa 0.0.5 → 0.0.6
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/.rspec +0 -1
- data/README.md +41 -13
- data/lib/tfa/totp_command.rb +6 -2
- data/lib/tfa/version.rb +1 -1
- data/spec/lib/totp_command_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31998f68b2ffd5161cc0349d47aa078b5d09d356
|
4
|
+
data.tar.gz: 08f0e8fcf9955ffe4b07073766d0108a2fcc2919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da32ced0dce6eb07611e48bc019c0fac3f729051cac8cb838d3437c6045cf0b46bab2ecb096957fcd0daa74e939d38049396e3f3575767cc2f34ca0ae93a81f1
|
7
|
+
data.tar.gz: 0d5b37925f8a2b3c67c4bb533d93d34468e85496e9c86b393e174b86ee27fd1fbef3dbf87c156bd39ee3ee40c435f13d3a65ec7b3a0ca03df651c15050f9db75
|
data/.rspec
CHANGED
data/README.md
CHANGED
@@ -1,32 +1,60 @@
|
|
1
|
-
#
|
1
|
+
# two factor authentication
|
2
2
|
|
3
3
|
[](https://travis-ci.org/mokhan/tfa)
|
4
|
+
[](https://codeclimate.com/github/mokhan/tfa)
|
5
|
+
[](https://gitter.im/mokhan/tfa)
|
4
6
|
|
5
|
-
|
7
|
+
This CLI helps to manage your one time passwords for different accounts/environments.
|
8
|
+
The goal of this tool is to help you generate one time passwords quickly
|
9
|
+
from the command line that you can pipe into your clipboard. This saves
|
10
|
+
you from having to pull out your phone and cracking open the Google
|
11
|
+
Authenticator app to generate a one time password.
|
6
12
|
|
13
|
+
In order to use this software you will need access to the secret
|
14
|
+
embedded in the provisioning uri used to set up your two factor
|
15
|
+
authentication account. This usually comes in the form of a QR Code
|
16
|
+
and might look like:
|
7
17
|
|
8
|
-
|
18
|
+
```ruby
|
19
|
+
'otpauth://totp/alice@google.com?secret=JBSWY3DPEHPK3PXP'
|
20
|
+
```
|
9
21
|
|
10
|
-
|
22
|
+
## Installation
|
11
23
|
|
12
|
-
gem
|
24
|
+
$ gem install tfa
|
13
25
|
|
14
|
-
|
26
|
+
## Usage
|
15
27
|
|
16
|
-
|
28
|
+
To add a secret you can use the add command. The key you use can be
|
29
|
+
anything you choose. In the example below the key is development.
|
17
30
|
|
18
|
-
|
31
|
+
```shell
|
32
|
+
$ tfa add development <secret>
|
33
|
+
```
|
19
34
|
|
20
|
-
|
35
|
+
To display the secret associated with a key:
|
21
36
|
|
22
|
-
|
37
|
+
```shell
|
38
|
+
$ tfa show development
|
39
|
+
```
|
23
40
|
|
41
|
+
To generate a time based one time password for a specific key.
|
24
42
|
|
25
43
|
```shell
|
26
|
-
$ tfa add
|
27
|
-
$ tfa add develoment <secret>
|
28
|
-
$ tfa show development
|
29
44
|
$ tfa totp development
|
45
|
+
$ 260182
|
46
|
+
```
|
47
|
+
|
48
|
+
You can also pipe it to your clipboard.
|
49
|
+
|
50
|
+
```shell
|
51
|
+
$ tfa totp development | pbcopy
|
52
|
+
```
|
53
|
+
|
54
|
+
or
|
55
|
+
|
56
|
+
```shell
|
57
|
+
$ tfa totp development | xclip -selection clipboard
|
30
58
|
```
|
31
59
|
|
32
60
|
## Contributing
|
data/lib/tfa/totp_command.rb
CHANGED
@@ -5,7 +5,7 @@ module TFA
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def run(arguments)
|
8
|
-
return password_for(secret_for(arguments.first)) if arguments
|
8
|
+
return password_for(secret_for(arguments.first)) if valid?(arguments)
|
9
9
|
all_passwords
|
10
10
|
end
|
11
11
|
|
@@ -24,7 +24,11 @@ module TFA
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def secret_for(key)
|
27
|
-
@storage.secret_for(key)
|
27
|
+
@storage.secret_for(key)
|
28
|
+
end
|
29
|
+
|
30
|
+
def valid?(arguments)
|
31
|
+
arguments.any? && secret_for(arguments.first)
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
data/lib/tfa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mo khan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rotp
|