conjur-asset-service-gateway-api 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 64e2509a2452d01266b71bfb2a26504f88cd6dee
4
+ data.tar.gz: 5068e7790d184e7c40e798e38567e33a3dc8772b
5
+ SHA512:
6
+ metadata.gz: 9a6d752d246069c3bb89302ad82587bb5e1a49eba2cb805ffab7a053ebeb7f331005143630c8caee573b45e24e9bc0bb0fc4a124d87120a804f2742f9f2515fb
7
+ data.tar.gz: ed55922dd68849792f319aa7d4276b10ad65101c04433b9a228d69461662d0e58bedc1c4119dcceb5948cbbee2f21a8a1697caccf0db946eb43fbab51e7deae5
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ coverage
2
+ .bundle/
3
+ log/*.log
4
+ pkg/
5
+ spec/dummy/db/*.sqlite3
6
+ spec/dummy/db/schema.rb
7
+ spec/dummy/log/*.log
8
+ spec/dummy/tmp/
9
+ spec/dummy/.sass-cache
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in conjur-asset-service-gateway.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec
7
+
8
+ gem 'rails-api'
9
+ gem 'webmock'
10
+ gem 'rspec-rails'
11
+ gem 'selenium-webdriver'
12
+
13
+ gem 'authable', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/authable.git', branch: 'master'
14
+ gem 'conjur-api', git: 'https://github.com/inscitiv/api-ruby.git', branch: 'master'
15
+ gem 'conjur-asset-key-pair', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-key-pair.git', branch: 'master'
16
+ gem 'slosilo', git: 'https://github.com/inscitiv/slosilo.git', branch: 'master'
data/Gemfile.lock ADDED
@@ -0,0 +1,222 @@
1
+ GIT
2
+ remote: https://github.com/inscitiv/api-ruby.git
3
+ revision: 90dcd6174deb3369e9c4680f9fc4721a6e19394a
4
+ branch: master
5
+ specs:
6
+ conjur-api (2.4.0)
7
+ activesupport
8
+ rest-client
9
+
10
+ GIT
11
+ remote: https://github.com/inscitiv/slosilo.git
12
+ revision: f6d31c1553cde5285b6e13781bf070112b7f9a45
13
+ branch: master
14
+ specs:
15
+ slosilo (0.3.0)
16
+
17
+ GIT
18
+ remote: https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/authable.git
19
+ revision: 3f3680aa5f966e2d7f7bafcb1d25012174cc73a5
20
+ branch: master
21
+ specs:
22
+ authable (0.2.0)
23
+ activesupport
24
+ conjur-api
25
+ slosilo
26
+
27
+ GIT
28
+ remote: https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-key-pair.git
29
+ revision: a8b309634b5b8561fe4886af9f44838bdc80dcfd
30
+ branch: master
31
+ specs:
32
+ conjur-asset-key-pair (0.2.0)
33
+ conjur-api
34
+
35
+ PATH
36
+ remote: .
37
+ specs:
38
+ conjur-asset-service-gateway-api (0.5.2)
39
+ conjur-api
40
+
41
+ GEM
42
+ remote: http://rubygems.org/
43
+ specs:
44
+ actionmailer (3.2.13)
45
+ actionpack (= 3.2.13)
46
+ mail (~> 2.5.3)
47
+ actionpack (3.2.13)
48
+ activemodel (= 3.2.13)
49
+ activesupport (= 3.2.13)
50
+ builder (~> 3.0.0)
51
+ erubis (~> 2.7.0)
52
+ journey (~> 1.0.4)
53
+ rack (~> 1.4.5)
54
+ rack-cache (~> 1.2)
55
+ rack-test (~> 0.6.1)
56
+ sprockets (~> 2.2.1)
57
+ activemodel (3.2.13)
58
+ activesupport (= 3.2.13)
59
+ builder (~> 3.0.0)
60
+ activerecord (3.2.13)
61
+ activemodel (= 3.2.13)
62
+ activesupport (= 3.2.13)
63
+ arel (~> 3.0.2)
64
+ tzinfo (~> 0.3.29)
65
+ activeresource (3.2.13)
66
+ activemodel (= 3.2.13)
67
+ activesupport (= 3.2.13)
68
+ activesupport (3.2.13)
69
+ i18n (= 0.6.1)
70
+ multi_json (~> 1.0)
71
+ addressable (2.3.4)
72
+ arel (3.0.2)
73
+ builder (3.0.4)
74
+ capybara (2.1.0)
75
+ mime-types (>= 1.16)
76
+ nokogiri (>= 1.3.3)
77
+ rack (>= 1.0.0)
78
+ rack-test (>= 0.5.4)
79
+ xpath (~> 2.0)
80
+ childprocess (0.3.9)
81
+ ffi (~> 1.0, >= 1.0.11)
82
+ ci_reporter (1.8.4)
83
+ builder (>= 2.1.2)
84
+ crack (0.4.0)
85
+ safe_yaml (~> 0.9.0)
86
+ cucumber (1.3.2)
87
+ builder (>= 2.1.2)
88
+ diff-lcs (>= 1.1.3)
89
+ gherkin (~> 2.12.0)
90
+ multi_json (~> 1.3)
91
+ cucumber-rails (1.3.1)
92
+ capybara (>= 1.1.2)
93
+ cucumber (>= 1.2.0)
94
+ nokogiri (>= 1.5.0)
95
+ rails (~> 3.0)
96
+ diff-lcs (1.2.4)
97
+ erubis (2.7.0)
98
+ ffi (1.9.0)
99
+ gherkin (2.12.0)
100
+ multi_json (~> 1.3)
101
+ hike (1.2.3)
102
+ i18n (0.6.1)
103
+ journey (1.0.4)
104
+ json (1.8.0)
105
+ json_spec (1.1.1)
106
+ multi_json (~> 1.0)
107
+ rspec (~> 2.0)
108
+ mail (2.5.4)
109
+ mime-types (~> 1.16)
110
+ treetop (~> 1.4.8)
111
+ mime-types (1.23)
112
+ mini_portile (0.5.0)
113
+ multi_json (1.7.7)
114
+ nokogiri (1.6.0)
115
+ mini_portile (~> 0.5.0)
116
+ pg (0.15.1)
117
+ pg_random_id (1.0.0)
118
+ polyglot (0.3.3)
119
+ rack (1.4.5)
120
+ rack-cache (1.2)
121
+ rack (>= 0.4)
122
+ rack-ssl (1.3.3)
123
+ rack
124
+ rack-test (0.6.2)
125
+ rack (>= 1.0)
126
+ rails (3.2.13)
127
+ actionmailer (= 3.2.13)
128
+ actionpack (= 3.2.13)
129
+ activerecord (= 3.2.13)
130
+ activeresource (= 3.2.13)
131
+ activesupport (= 3.2.13)
132
+ bundler (~> 1.0)
133
+ railties (= 3.2.13)
134
+ rails-api (0.1.0)
135
+ actionpack (>= 3.2.11)
136
+ railties (>= 3.2.11)
137
+ tzinfo (~> 0.3.31)
138
+ railties (3.2.13)
139
+ actionpack (= 3.2.13)
140
+ activesupport (= 3.2.13)
141
+ rack-ssl (~> 1.3.2)
142
+ rake (>= 0.8.7)
143
+ rdoc (~> 3.4)
144
+ thor (>= 0.14.6, < 2.0)
145
+ rake (10.1.0)
146
+ rdoc (3.12.2)
147
+ json (~> 1.4)
148
+ rest-client (1.6.7)
149
+ mime-types (>= 1.16)
150
+ rspec (2.13.0)
151
+ rspec-core (~> 2.13.0)
152
+ rspec-expectations (~> 2.13.0)
153
+ rspec-mocks (~> 2.13.0)
154
+ rspec-core (2.13.1)
155
+ rspec-expectations (2.13.0)
156
+ diff-lcs (>= 1.1.3, < 2.0)
157
+ rspec-mocks (2.13.1)
158
+ rspec-rails (2.13.2)
159
+ actionpack (>= 3.0)
160
+ activesupport (>= 3.0)
161
+ railties (>= 3.0)
162
+ rspec-core (~> 2.13.0)
163
+ rspec-expectations (~> 2.13.0)
164
+ rspec-mocks (~> 2.13.0)
165
+ rubyzip (0.9.9)
166
+ safe_yaml (0.9.3)
167
+ selenium-webdriver (2.33.0)
168
+ childprocess (>= 0.2.5)
169
+ multi_json (~> 1.0)
170
+ rubyzip
171
+ websocket (~> 1.0.4)
172
+ sequel (3.48.0)
173
+ sequel-attribute_callbacks (0.1.0)
174
+ sequel (~> 3.44)
175
+ simplecov (0.7.1)
176
+ multi_json (~> 1.0)
177
+ simplecov-html (~> 0.7.1)
178
+ simplecov-html (0.7.1)
179
+ spork (0.9.2)
180
+ sprockets (2.2.2)
181
+ hike (~> 1.2)
182
+ multi_json (~> 1.0)
183
+ rack (~> 1.0)
184
+ tilt (~> 1.1, != 1.3.0)
185
+ talentbox-sequel-rails (0.3.10)
186
+ railties (~> 3.2.0)
187
+ sequel (~> 3.28)
188
+ thor (0.18.1)
189
+ tilt (1.4.1)
190
+ treetop (1.4.14)
191
+ polyglot
192
+ polyglot (>= 0.3.1)
193
+ tzinfo (0.3.37)
194
+ webmock (1.12.0)
195
+ addressable (>= 2.2.7)
196
+ crack (>= 0.3.2)
197
+ websocket (1.0.7)
198
+ xpath (2.0.0)
199
+ nokogiri (~> 1.3)
200
+
201
+ PLATFORMS
202
+ ruby
203
+
204
+ DEPENDENCIES
205
+ authable!
206
+ ci_reporter
207
+ conjur-api!
208
+ conjur-asset-key-pair!
209
+ conjur-asset-service-gateway-api!
210
+ cucumber-rails
211
+ json_spec
212
+ pg
213
+ pg_random_id
214
+ rails-api
215
+ rspec-rails
216
+ selenium-webdriver
217
+ sequel-attribute_callbacks
218
+ simplecov
219
+ slosilo!
220
+ spork
221
+ talentbox-sequel-rails
222
+ webmock
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = ConjurAssetDeployment
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'ConjurAssetService'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+
24
+
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
@@ -0,0 +1,49 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require "conjur-asset-service-gateway-version"
5
+
6
+ files = if ENV['API_ONLY']
7
+ exclude_dirs = [ ".project", ".rvmrc", "lib/conjur/asset", "config", "db", "features", "spec", "app" ]
8
+ `git ls-files`.split("\n").select do |f|
9
+ exclude_dirs.find{|d| f.index(d) == 0}.nil?
10
+ end.tap do |files|
11
+ puts "Packaging #{files.join(" ")}"
12
+ end
13
+ else
14
+ `git ls-files`.split($/)
15
+ end
16
+
17
+ name = if ENV['API_ONLY']
18
+ "conjur-asset-service-gateway-api"
19
+ else
20
+ "conjur-asset-service-gateway"
21
+ end
22
+
23
+ # Describe your gem and declare its dependencies:
24
+ Gem::Specification.new do |s|
25
+ s.name = name
26
+ s.version = Conjur::Asset::ServiceGateway::VERSION
27
+ s.authors = ["Kevin Gilpin"]
28
+ s.email = ["kgilpin@gmail.com"]
29
+ s.homepage = "http://conjur.net"
30
+ s.summary = "Conjur asset plugin for the remote services gateway."
31
+
32
+ s.files = files
33
+
34
+ s.add_dependency "conjur-api"
35
+
36
+ s.add_development_dependency "authable"
37
+ s.add_development_dependency "rails-api"
38
+ s.add_development_dependency "talentbox-sequel-rails"
39
+ s.add_development_dependency "pg"
40
+ s.add_development_dependency "pg_random_id"
41
+ s.add_development_dependency "sequel-attribute_callbacks"
42
+ s.add_development_dependency "rspec-rails"
43
+ s.add_development_dependency "cucumber-rails"
44
+ s.add_development_dependency "spork"
45
+ s.add_development_dependency "simplecov"
46
+ s.add_development_dependency "webmock"
47
+ s.add_development_dependency "json_spec"
48
+ s.add_development_dependency "ci_reporter"
49
+ end
@@ -0,0 +1,7 @@
1
+ module Conjur
2
+ module Asset
3
+ module ServiceGateway
4
+ VERSION = "0.5.2"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ require "conjur-asset-service-gateway-version"
2
+ require "conjur/api"
3
+ require "conjur/service-gateway-api"
4
+
5
+ require "conjur/asset/service-gateway/engine" if defined?(Rails) && ENV['CONJUR_ASSET_SERVICE']
@@ -0,0 +1,17 @@
1
+ require 'conjur/service_gateway'
2
+
3
+ module Conjur
4
+ class API
5
+ def create_service_gateway(id, options = {})
6
+ standard_create Conjur::ServiceGateways::API.host, :service_gateway, id, options
7
+ end
8
+
9
+ def service_gateways(options = {})
10
+ standard_list Conjur::ServiceGateways::API.host, :service_gateway, options
11
+ end
12
+
13
+ def service_gateway id
14
+ standard_show Conjur::ServiceGateways::API.host, :service_gateway, id
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ require 'conjur/web_service'
2
+
3
+ module Conjur
4
+ class API
5
+ def create_web_service(id, service_gateway, adapter, options = {})
6
+ standard_create Conjur::ServiceGateways::API.host, :web_service, id, options.merge(service_gateway_id: service_gateway, adapter: adapter)
7
+ end
8
+
9
+ def web_service id
10
+ standard_show Conjur::ServiceGateways::API.host, :web_service, id
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,63 @@
1
+ require 'conjur/command'
2
+
3
+ class Conjur::Command::ServiceGateways < Conjur::Command
4
+ self.prefix = :"service-gateway"
5
+
6
+ desc "Add a proxy to a service gateway. The proxy is identified by role."
7
+ arg_name "service-gateway role"
8
+ command :"proxies:add" do |c|
9
+ c.action do |global_options, options, args|
10
+ id = require_arg(args, 'service-gateway')
11
+ role = require_arg(args, 'role')
12
+
13
+ api.service_gateway(id).add_proxy role
14
+ puts "Proxy added"
15
+ end
16
+ end
17
+
18
+ desc "Remove a host from an service gateway"
19
+ arg_name "service-gateway role"
20
+ command :"proxies:remove" do |c|
21
+ c.action do |global_options, options, args|
22
+ id = require_arg(args, 'service-gateway')
23
+ role = require_arg(args, 'role')
24
+
25
+ api.service_gateway(id).remove_proxy role
26
+ puts "Proxy removed"
27
+ end
28
+ end
29
+
30
+ desc "Remove a web service from an service gateway"
31
+ arg_name "service-gateway web-service"
32
+ command :"web-services:remove" do |c|
33
+ c.action do |global_options, options, args|
34
+ id = require_arg(args, 'service-gateway')
35
+ web_service = require_arg(args, 'web-service')
36
+
37
+ api.service_gateway(id).remove_web_service web_service
38
+ puts "WebService removed"
39
+ end
40
+ end
41
+
42
+ desc "Encrypt a web service credential"
43
+ arg_name "service-gateway (value | STDIN)"
44
+ command :"encrypt" do |c|
45
+ c.action do |global_options, options, args|
46
+ id = require_arg(args, 'service-gateway')
47
+ value = args.shift || STDIN.read
48
+
49
+ $stdout.write api.service_gateway(id).encrypt value
50
+ end
51
+ end
52
+
53
+ desc "Decrypt a web service credential"
54
+ arg_name "service-gateway (value | STDIN)"
55
+ command :"decrypt" do |c|
56
+ c.action do |global_options, options, args|
57
+ id = require_arg(args, 'service-gateway')
58
+ value = args.shift || STDIN.read
59
+
60
+ $stdout.write api.service_gateway(id).decrypt value
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,93 @@
1
+ require 'conjur/command'
2
+
3
+ class Conjur::Command::WebServices < Conjur::Command
4
+ self.prefix = :"web-service"
5
+
6
+ desc "Create a web service"
7
+ arg_name "id service-gateway adapter"
8
+ command :create do |c|
9
+ acting_as_option(c)
10
+
11
+ c.action do |global_options, options, args|
12
+ id = require_arg(args, 'id')
13
+ service_gateway = require_arg(args, 'service-gateway')
14
+ adapter = require_arg(args, 'adapter')
15
+
16
+ args.each do |arg|
17
+ if arg =~ /([^=])+=(.+)/
18
+ k = $1
19
+ v = $2
20
+ options["adapter_parameters[#{k}]"] = v
21
+ else
22
+ $stderr.puts "Expecting key=value in parameter #{arg}"
23
+ end
24
+ end
25
+
26
+ record = api.create_web_service id, service_gateway, adapter, options
27
+ display(record, options)
28
+ end
29
+ end
30
+
31
+ desc "Sets the credential value"
32
+ arg_name "id ( value | STDIN )"
33
+ command :"credential:update" do |c|
34
+ c.action do |global_options,options,args|
35
+ id = require_arg(args, 'id')
36
+ value = args.shift || STDIN.read
37
+
38
+ variableid = api.web_service(id).credential = value
39
+
40
+ puts "Credential value updated"
41
+ end
42
+ end
43
+
44
+ desc "Gets the (encrypted) credential value"
45
+ arg_name "id"
46
+ command :"credential:value" do |c|
47
+ c.action do |global_options,options,args|
48
+ id = require_arg(args, 'id')
49
+
50
+ $stdout.write api.web_service(id).credential
51
+ end
52
+ end
53
+
54
+ desc "Validates a URL against the URL pattern and query parameter patterns"
55
+ arg_name "id url"
56
+ command :"validate-url" do |c|
57
+ acting_as_option(c)
58
+
59
+ c.action do |global_options, options, args|
60
+ id = require_arg(args, 'id')
61
+ url = require_arg(args, 'url')
62
+
63
+ api.web_service(id).validate_url(url)
64
+ puts "URL is valid"
65
+ end
66
+ end
67
+
68
+ desc "Add a client to a web service"
69
+ arg_name "web-service member"
70
+ command :"clients:add" do |c|
71
+ c.action do |global_options, options, args|
72
+ id = require_arg(args, 'web-service')
73
+ member = require_arg(args, 'member')
74
+
75
+ api.web_service(id).add_client member
76
+
77
+ puts "Membership granted"
78
+ end
79
+ end
80
+
81
+ desc "Removes a client from a web service"
82
+ arg_name "web-service member"
83
+ command :"clients:remove" do |c|
84
+ c.action do |global_options, options, args|
85
+ id = require_arg(args, 'web-service')
86
+ member = require_arg(args, 'member')
87
+
88
+ api.web_service(id).remove_client member
89
+
90
+ puts "Membership revoked"
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,20 @@
1
+ module Conjur
2
+ module ServiceGateways
3
+ class API < Conjur::API
4
+ class << self
5
+ def host
6
+ ENV['CONJUR_SERVICE_GATEWAY_URL'] || Conjur::Core::API.host
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ module Conjur
14
+ class API
15
+ include StandardMethods
16
+ end
17
+ end
18
+
19
+ require 'conjur/api/web_services'
20
+ require 'conjur/api/service_gateways'
@@ -0,0 +1,50 @@
1
+ module Conjur
2
+ class ServiceGateway < RestClient::Resource
3
+ include ActsAsAsset
4
+
5
+ def add_proxy(role)
6
+ log do |logger|
7
+ logger << "Adding proxy #{role} to service gateway #{id}"
8
+ end
9
+ invalidate do
10
+ RestClient::Resource.new(self['proxies'].url, options).post(role: role)
11
+ end
12
+ end
13
+
14
+ def remove_proxy(role)
15
+ log do |logger|
16
+ logger << "Removing proxy #{role} from service gateway #{id}"
17
+ end
18
+ invalidate do
19
+ RestClient::Resource.new(self["proxies/#{fully_escape role}"].url, self.options).delete
20
+ end
21
+ end
22
+
23
+ def remove_web_service(id)
24
+ log do |logger|
25
+ logger << "Removing web service #{id} from service gateway #{id}"
26
+ end
27
+ invalidate do
28
+ RestClient::Resource.new(self["web_services/#{fully_escape id}"].url, self.options).delete
29
+ end
30
+ end
31
+
32
+ def web_services
33
+ self.attributes['web_services'].values.collect do |attrs|
34
+ Conjur::WebService.new("#{Conjur::WebServices::API.host}/web_services/#{path_escape attrs['id']}", options).tap do |d|
35
+ d.attributes = attrs
36
+ end
37
+ end
38
+ end
39
+
40
+ def encrypt(data)
41
+ raise ArgumentError.new("data must not be nil") unless data
42
+ self["encrypt"].post(data, content_type: 'application/octet-stream').body
43
+ end
44
+
45
+ def decrypt(data)
46
+ raise ArgumentError.new("data must not be nil") unless data
47
+ self["decrypt"].post(data, content_type: 'application/octet-stream').body
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,35 @@
1
+ module Conjur
2
+ class WebService < RestClient::Resource
3
+ include ActsAsAsset
4
+
5
+ def add_client(member)
6
+ RestClient::Resource.new(self["clients"].url, self.options).post(id: member)
7
+ end
8
+
9
+ def remove_client(member)
10
+ RestClient::Resource.new(self["clients/#{fully_escape member}"].url, self.options).delete
11
+ end
12
+
13
+ def credential_variable
14
+ Conjur::Variable.new(Conjur::Core::API.host, self.options)["variables/#{credentialid}"]
15
+ end
16
+
17
+ def credential(version=nil)
18
+ url = 'credential'
19
+ url << "?version=#{version}" if version
20
+ self[url].get.body
21
+ end
22
+
23
+ def credential=(value)
24
+ self["credential"].put(value)
25
+ end
26
+
27
+ def credentialid
28
+ attributes['credentialid']
29
+ end
30
+
31
+ def validate_url(url)
32
+ self["validate_url?url=#{query_escape url}"].get
33
+ end
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,255 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: conjur-asset-service-gateway-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.2
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Gilpin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: conjur-api
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: authable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails-api
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: talentbox-sequel-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pg
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: pg_random_id
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sequel-attribute_callbacks
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: cucumber-rails
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: spork
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: simplecov
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: webmock
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: json_spec
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: ci_reporter
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description:
210
+ email:
211
+ - kgilpin@gmail.com
212
+ executables: []
213
+ extensions: []
214
+ extra_rdoc_files: []
215
+ files:
216
+ - .gitignore
217
+ - Gemfile
218
+ - Gemfile.lock
219
+ - MIT-LICENSE
220
+ - README.rdoc
221
+ - Rakefile
222
+ - conjur-asset-service-gateway.gemspec
223
+ - lib/conjur-asset-service-gateway-version.rb
224
+ - lib/conjur-asset-service-gateway.rb
225
+ - lib/conjur/api/service_gateways.rb
226
+ - lib/conjur/api/web_services.rb
227
+ - lib/conjur/command/service_gateways.rb
228
+ - lib/conjur/command/web_services.rb
229
+ - lib/conjur/service-gateway-api.rb
230
+ - lib/conjur/service_gateway.rb
231
+ - lib/conjur/web_service.rb
232
+ homepage: http://conjur.net
233
+ licenses: []
234
+ metadata: {}
235
+ post_install_message:
236
+ rdoc_options: []
237
+ require_paths:
238
+ - lib
239
+ required_ruby_version: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - '>='
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ required_rubygems_version: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - '>='
247
+ - !ruby/object:Gem::Version
248
+ version: '0'
249
+ requirements: []
250
+ rubyforge_project:
251
+ rubygems_version: 2.0.3
252
+ signing_key:
253
+ specification_version: 4
254
+ summary: Conjur asset plugin for the remote services gateway.
255
+ test_files: []