alcatraz-client 0.0.4 → 0.0.5
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/alcatraz/client/connection.rb +26 -0
- data/lib/alcatraz/client/version.rb +1 -1
- 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: b358d683e179b0ee723229c16921365d09781323
|
4
|
+
data.tar.gz: 3350551e65059ae61cc6050968123ef42225027c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11be3fa582b9325e5ea35202bd220176f0f906cfab90ed807f67785768c645b9075ff84eb43be9961e1cf8a830b35d03a3042aa1aac9c9734403e4e0dd9b355
|
7
|
+
data.tar.gz: 6b98d8a22c785aa4cb6009d604235fa77771fd8debe08e24a5246a31bc9993e600576f704aaa0771f85f134b197630ff58ff943951f3b6796e53031ab66f9ec3
|
@@ -42,6 +42,28 @@ module Alcatraz
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
def destroy_client!(id)
|
46
|
+
delete("/api_clients/#{id}")
|
47
|
+
end
|
48
|
+
|
49
|
+
def enable_two_factor_auth!(id)
|
50
|
+
response = put("/api_clients/#{id}/enable_two_factor_auth")
|
51
|
+
if response.success?
|
52
|
+
response.body.api_client
|
53
|
+
else
|
54
|
+
nil
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def disable_two_factor_auth!(id)
|
59
|
+
response = put("/api_clients/#{id}/disable_two_factor_auth")
|
60
|
+
if response.success?
|
61
|
+
response.body.api_client
|
62
|
+
else
|
63
|
+
nil
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
45
67
|
def authorize_data_for_client!(data_or_id, client_or_public_key)
|
46
68
|
data_id = unwrap_to_id data_or_id
|
47
69
|
public_key = unwrap_to_key client_or_public_key
|
@@ -84,6 +106,10 @@ module Alcatraz
|
|
84
106
|
connection.post(path, options)
|
85
107
|
end
|
86
108
|
|
109
|
+
def put(path, options = {})
|
110
|
+
connection.put(path, options)
|
111
|
+
end
|
112
|
+
|
87
113
|
def delete(path)
|
88
114
|
response = connection.delete(path)
|
89
115
|
response.success?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alcatraz-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian McManus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|