authentise 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authentise/api/users.rb +6 -2
- data/lib/authentise/api/warehouse.rb +1 -0
- data/lib/authentise/version.rb +1 -1
- data/spec/api/users_spec.rb +8 -4
- 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: 8831efc0f80e0d3cbc488c684dba2cf68c084380
|
4
|
+
data.tar.gz: 685b461ee213f942ed733faf08c5a90a0f2b5749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 059140001e9dce738fd90447531375cacfec7f3c6bee96eee3adbabf804462780f98906f3a74dcc3a0193b632c5042eb5089ef150df623316ca9f7298d2fb424
|
7
|
+
data.tar.gz: 0cb7c4ce7993280a175c8ee928bb75ef2caa5c5ae24fd130d68a7cd14807e97c979af9cc0b21cf97d99396bafdae47d36e957f40d2fddbad91dd5cef3ab22bce
|
data/lib/authentise/api/users.rb
CHANGED
@@ -25,7 +25,9 @@ module Authentise
|
|
25
25
|
open_timeout: 2,
|
26
26
|
timeout: 2,
|
27
27
|
}
|
28
|
-
|
28
|
+
body = params.to_json
|
29
|
+
|
30
|
+
RestClient.post(url, body, options) do |response, _request, _result|
|
29
31
|
json = JSON.parse(response)
|
30
32
|
if response.code == 201
|
31
33
|
{
|
@@ -54,7 +56,9 @@ module Authentise
|
|
54
56
|
open_timeout: 2,
|
55
57
|
timeout: 2,
|
56
58
|
}
|
57
|
-
|
59
|
+
body = params.to_json
|
60
|
+
|
61
|
+
RestClient.post(url, body, options) do |response, _request, _result|
|
58
62
|
if response.code == 201
|
59
63
|
{
|
60
64
|
token: response.cookies["session"],
|
data/lib/authentise/version.rb
CHANGED
data/spec/api/users_spec.rb
CHANGED
@@ -15,11 +15,13 @@ describe Authentise::API::Users do
|
|
15
15
|
name: "Test User",
|
16
16
|
username: "testuser",
|
17
17
|
password: "password",
|
18
|
-
}
|
18
|
+
}.to_json
|
19
|
+
|
19
20
|
@request_headers = {
|
20
21
|
"Accept" => "application/json",
|
21
|
-
"Content-Type" => "application/
|
22
|
+
"Content-Type" => "application/json",
|
22
23
|
}
|
24
|
+
|
23
25
|
@response_body = {
|
24
26
|
name: "Test User",
|
25
27
|
username: "testuser",
|
@@ -68,11 +70,13 @@ describe Authentise::API::Users do
|
|
68
70
|
@request_body = {
|
69
71
|
username: "testuser",
|
70
72
|
password: "password",
|
71
|
-
}
|
73
|
+
}.to_json
|
74
|
+
|
72
75
|
@request_headers = {
|
73
76
|
"Accept" => "application/json",
|
74
|
-
"Content-Type" => "application/
|
77
|
+
"Content-Type" => "application/json",
|
75
78
|
}
|
79
|
+
|
76
80
|
@response_headers = {
|
77
81
|
"Set-Cookie" => "session=f4242aef; " \
|
78
82
|
"expires=Thu, 27-Apr-2017 08:49:20 GMT; " \
|