instant2fa 0.0.1 → 0.0.2
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/README.md +6 -12
- data/instant2fa.gemspec +1 -1
- data/lib/instant2fa/client.rb +2 -2
- data/lib/instant2fa/configuration.rb +1 -1
- data/lib/instant2fa/errors.rb +6 -6
- data/lib/instant2fa/middleware/unprocessable_entity_status.rb +1 -1
- data/lib/instant2fa/resources.rb +1 -1
- data/lib/instant2fa/version.rb +2 -2
- data/lib/instant2fa.rb +4 -2
- 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: 78b529c5f27ed50fee4234cf440e04426ef0d161
|
4
|
+
data.tar.gz: e86645df4674d91c104e3e2ef2b9a9ac22bca3ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb236e3aa2fd4b83855348cbc47ca9798cfa541a388aecd7cc233a951a831d9a50dbdc0921e79333cc61da5581da29d4bd3d84976c5b4112ea495321299187d
|
7
|
+
data.tar.gz: ffac06ea1978043f4510c5dd3de245340dd724d83d92775d39d0f199db124b8da2b6730192a63fd84ca8fc22693e7e60ce2879e8f2af6344604d2f1cce6b7c2a
|
data/README.md
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/instant2fa`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
1
|
+
# Instant2fa
|
6
2
|
|
7
3
|
## Installation
|
8
4
|
|
@@ -23,20 +19,18 @@ Or install it yourself as:
|
|
23
19
|
## Usage
|
24
20
|
|
25
21
|
```ruby
|
26
|
-
|
22
|
+
Instant2fa.configure do |config|
|
27
23
|
config.access_key = 'YOUR_ACCESS_KEY'
|
28
24
|
config.access_secret = 'YOUR_ACCESS_SECRET'
|
29
25
|
end
|
30
26
|
|
31
27
|
distinct_id = "A_UNIQUE_ID_FOR_A_USER"
|
32
28
|
|
33
|
-
hosted_page_url =
|
34
|
-
hosted_page_url =
|
35
|
-
verification_succeeded =
|
29
|
+
hosted_page_url = Instant2fa.create_settings(distinct_id)
|
30
|
+
hosted_page_url = Instant2fa.create_verification(distinct_id)
|
31
|
+
verification_succeeded = Instant2fa.confirm_verification(distinct_id, token)
|
36
32
|
```
|
37
33
|
|
38
|
-
TODO: Write usage instructions here
|
39
|
-
|
40
34
|
## Development
|
41
35
|
|
42
36
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -45,7 +39,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
45
39
|
|
46
40
|
## Contributing
|
47
41
|
|
48
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
42
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/clef/instant2fa-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
49
43
|
|
50
44
|
|
51
45
|
## License
|
data/instant2fa.gemspec
CHANGED
data/lib/instant2fa/client.rb
CHANGED
@@ -5,12 +5,12 @@ require 'instant2fa/resources'
|
|
5
5
|
require 'instant2fa/errors'
|
6
6
|
require 'instant2fa/middleware/unprocessable_entity_status'
|
7
7
|
|
8
|
-
module
|
8
|
+
module Instant2fa
|
9
9
|
class Client
|
10
10
|
|
11
11
|
attr_accessor :config
|
12
12
|
|
13
|
-
def initialize(config=
|
13
|
+
def initialize(config=Instant2fa.config.dup, options={})
|
14
14
|
@config = config
|
15
15
|
|
16
16
|
Resources::Base.site = @config.api_base
|
data/lib/instant2fa/errors.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
module
|
1
|
+
module Instant2fa
|
2
2
|
module Errors
|
3
|
-
class
|
3
|
+
class Instant2faError < StandardError
|
4
4
|
end
|
5
5
|
|
6
|
-
class MFANotEnabled <
|
6
|
+
class MFANotEnabled < Instant2faError
|
7
7
|
end
|
8
8
|
|
9
|
-
class ValidationError <
|
9
|
+
class ValidationError < Instant2faError
|
10
10
|
end
|
11
11
|
|
12
|
-
class VerificationMismatch <
|
12
|
+
class VerificationMismatch < Instant2faError
|
13
13
|
end
|
14
14
|
|
15
|
-
class VerificationFailed <
|
15
|
+
class VerificationFailed < Instant2faError
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/instant2fa/resources.rb
CHANGED
data/lib/instant2fa/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.0.
|
1
|
+
module Instant2fa
|
2
|
+
VERSION = "0.0.2"
|
3
3
|
end
|
data/lib/instant2fa.rb
CHANGED
@@ -5,7 +5,7 @@ require "instant2fa/version"
|
|
5
5
|
require "instant2fa/configuration"
|
6
6
|
require "instant2fa/client"
|
7
7
|
|
8
|
-
module
|
8
|
+
module Instant2fa
|
9
9
|
extend self
|
10
10
|
|
11
11
|
def configure
|
@@ -16,7 +16,7 @@ module Instant2FA
|
|
16
16
|
@config ||= Configuration.new
|
17
17
|
end
|
18
18
|
|
19
|
-
def new(config=
|
19
|
+
def new(config=Instant2fa.config.dup, options={})
|
20
20
|
Client.new(config, options)
|
21
21
|
end
|
22
22
|
|
@@ -27,3 +27,5 @@ module Instant2FA
|
|
27
27
|
delegate(*Configuration.public_instance_methods(false), to: :config)
|
28
28
|
delegate(*Client.public_instance_methods(false) - [:config], to: :client)
|
29
29
|
end
|
30
|
+
|
31
|
+
Instant2FA = Instant2fa
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instant2fa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Pollak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|