minty 1.0.0 → 1.0.1
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/minty/api/authentication_endpoints.rb +28 -3
- data/lib/minty/exception.rb +9 -1
- data/lib/minty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0c9e9f92d106139eef7a403d2aa557686e9c45baf402ce293eddbfa2e1b7850
|
4
|
+
data.tar.gz: 67fa0301318d1a8f61e1b6bcc511cac063e18a863d1f29fa815a83cb96144a9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98b3c9ce3bd30445ba41a7eb58765d2b2347bd81fe65912abc55af0d84b6db9af170f2daaa159f9946f7bf0eca2137d20f72c334dfa739846b75e39b37f82859
|
7
|
+
data.tar.gz: 7730bc78bbc6a7ac538db19d65c1e1823cba8e27c6da46e6c5b5aa63d8722f292690c7cd1a69b4b510f8a0e6de9d96cced75a3e4cd4e153d6eb494ed1482bfa1
|
@@ -5,21 +5,46 @@ require 'jwt'
|
|
5
5
|
module Minty
|
6
6
|
module Api
|
7
7
|
module AuthenticationEndpoints
|
8
|
-
def sign_in_url
|
8
|
+
def sign_in_url
|
9
9
|
response = request_with_retry(:get, '/sign_in_url')
|
10
10
|
response['redirect_url']
|
11
11
|
end
|
12
12
|
|
13
|
-
def sign_up_url
|
13
|
+
def sign_up_url
|
14
14
|
response = request_with_retry(:get, '/sign_up_url')
|
15
15
|
response['redirect_url']
|
16
16
|
end
|
17
17
|
|
18
|
-
def forgot_password_url
|
18
|
+
def forgot_password_url
|
19
19
|
response = request_with_retry(:get, '/forgot_password_url')
|
20
20
|
response['redirect_url']
|
21
21
|
end
|
22
22
|
|
23
|
+
def sign_in(email, password)
|
24
|
+
request_with_retry(:post, '/sign_in', { email: email, password: password })
|
25
|
+
end
|
26
|
+
|
27
|
+
def sign_up(name, email, password)
|
28
|
+
request_with_retry(:post, '/sign_up', { name: name, email: email, password: password })
|
29
|
+
end
|
30
|
+
|
31
|
+
def sign_out(token)
|
32
|
+
request_with_retry(:delete, '/sign_out', { token: token })
|
33
|
+
end
|
34
|
+
|
35
|
+
def forgot_password(email)
|
36
|
+
request_with_retry(:post, '/forgot_password', { email: email })
|
37
|
+
end
|
38
|
+
|
39
|
+
def validate_token(token)
|
40
|
+
request_with_retry(:get, '/validate_token', { token: token })
|
41
|
+
end
|
42
|
+
|
43
|
+
def application_user(token)
|
44
|
+
response = request_with_retry(:get, '/application_user', { token: token })
|
45
|
+
response['application_user']
|
46
|
+
end
|
47
|
+
|
23
48
|
private
|
24
49
|
|
25
50
|
def to_query(hash)
|
data/lib/minty/exception.rb
CHANGED
@@ -11,13 +11,21 @@ module Minty
|
|
11
11
|
end
|
12
12
|
|
13
13
|
class HTTPError < Minty::Exception
|
14
|
-
def
|
14
|
+
def http_headers
|
15
15
|
error_data[:headers]
|
16
16
|
end
|
17
17
|
|
18
18
|
def http_code
|
19
19
|
error_data[:code]
|
20
20
|
end
|
21
|
+
|
22
|
+
def http_response
|
23
|
+
JSON.parse(to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
def message
|
27
|
+
http_response['message']
|
28
|
+
end
|
21
29
|
end
|
22
30
|
|
23
31
|
class Unauthorized < Minty::HTTPError; end
|
data/lib/minty/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|