alcatraz-client 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2332138aa3c4ab58a392c42835e204d8a55a1a73
4
- data.tar.gz: 4c464ecce02b4ce2cc3c73466cfede7517691e13
3
+ metadata.gz: b358d683e179b0ee723229c16921365d09781323
4
+ data.tar.gz: 3350551e65059ae61cc6050968123ef42225027c
5
5
  SHA512:
6
- metadata.gz: 1d96d84f5879f8fa9f5fdbf316413e60771ee39372bc382121dd634100022d36ecb3a4de2c8512507bdda4f635f613cc5be4760bcd3e112cc8a1beafd893f8cf
7
- data.tar.gz: 0c621bc111e64fc29b505b30cfc19d292da9a7c698d99ed1ee820375c8ef77a3e769d411d16bd9801f5ffa9c17bd9815acc908d110a0439235348ecbd7477642
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?
@@ -1,5 +1,5 @@
1
1
  module Alcatraz
2
2
  module Client
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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
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-19 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler