conjur-asset-trial-factory 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.conjurrc +3 -0
- data/.gitignore +22 -0
- data/.project +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -0
- data/conjur-asset-trial-factory.gemspec +26 -0
- data/features/create.feature +7 -0
- data/features/support/env.rb +2 -0
- data/features/support/hooks.rb +32 -0
- data/features/support/world.rb +64 -0
- data/lib/conjur-asset-trial-factory-version.rb +27 -0
- data/lib/conjur-asset-trial-factory.rb +22 -0
- data/lib/conjur/api/trial_factories.rb +65 -0
- data/lib/conjur/command/trial_factories.rb +64 -0
- data/lib/conjur/trial-factory-api.rb +43 -0
- data/lib/conjur/trial.rb +25 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4d79edef84ceea93fcb0dc362496b8822a6f4d8a
|
4
|
+
data.tar.gz: e23dd119995cc943d76c703fa179f2e65b02389f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ab6162bb5aba8f8bb11b87b43972b4fcff8b3495815ef5ebb99756c68b9a87ec10574112ed57cd67dacd4826471fa583121bc2b4a3153572b7144adcc2b4296a
|
7
|
+
data.tar.gz: 0897c07485bcb3313d6a4c9478ce22bf2a4f098a857cb21ac9b2952dfcf89ed3a25b92c0332ced295698373d0cb7c276c2946def0c11117af96501c9131ca84a
|
data/.conjurrc
ADDED
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/.project
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>conjur-asset-trial-factory</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>com.aptana.ide.core.unifiedBuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
</buildSpec>
|
14
|
+
<natures>
|
15
|
+
<nature>com.aptana.ruby.core.rubynature</nature>
|
16
|
+
<nature>com.aptana.projects.webnature</nature>
|
17
|
+
</natures>
|
18
|
+
</projectDescription>
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Kevin Gilpin
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Conjur::Asset::Trial::Factory
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'conjur-asset-trial-factory'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install conjur-asset-trial-factory
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/conjur-asset-trial-factory/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'conjur-asset-trial-factory-version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "conjur-asset-trial-factory"
|
8
|
+
spec.version = Conjur::Asset::TrialFactory::VERSION
|
9
|
+
spec.authors = ["Kevin Gilpin"]
|
10
|
+
spec.email = ["kgilpin@gmail.com"]
|
11
|
+
spec.summary = %q{Client library for managing Conjur trials.}
|
12
|
+
spec.homepage = "http://github.com/conjurinc/conjur-asset-trial-factory"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
21
|
+
spec.add_development_dependency "rake"
|
22
|
+
spec.add_development_dependency "conjur-cli"
|
23
|
+
spec.add_development_dependency "cucumber"
|
24
|
+
spec.add_development_dependency "json_spec"
|
25
|
+
spec.add_development_dependency "aruba"
|
26
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
require 'conjur/api'
|
3
|
+
require 'conjur/cli'
|
4
|
+
require 'conjur/authn'
|
5
|
+
|
6
|
+
netrc = Conjur::Authn.netrc
|
7
|
+
credentials = Conjur::Authn.get_credentials
|
8
|
+
username = credentials[0]
|
9
|
+
puts "Logging in as #{username}"
|
10
|
+
|
11
|
+
Before('@conjurapi-log') do
|
12
|
+
set_env 'CONJURAPI_LOG', 'stderr'
|
13
|
+
end
|
14
|
+
|
15
|
+
Before do
|
16
|
+
@admin_api = conjur_api = Conjur::API.new_from_key username, credentials[1]
|
17
|
+
|
18
|
+
@namespace = conjur_api.create_variable("text/plain", "id").id
|
19
|
+
user = conjur_api.create_user "admin@#{@namespace}", ownerid: "#{Conjur.configuration.account}:user:#{username}"
|
20
|
+
|
21
|
+
conjur_api = conjur_api = Conjur::API.new_from_key user.username, user.api_key
|
22
|
+
@security_admin = conjur_api.create_group [ @namespace, "security_admin" ].join('/')
|
23
|
+
@security_admin.add_member user, admin_option: true
|
24
|
+
|
25
|
+
JsonSpec.memorize "MY_ROLEID", %Q("#{user.roleid}")
|
26
|
+
|
27
|
+
@aruba_timeout_seconds = 10
|
28
|
+
end
|
29
|
+
|
30
|
+
After do
|
31
|
+
tempfiles.each { |tempfile| File.unlink(tempfile) unless tempfile.nil? }
|
32
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module ConjurCLIWorld
|
2
|
+
def last_json
|
3
|
+
stdout_from(@last_cmd)
|
4
|
+
end
|
5
|
+
|
6
|
+
def find_or_create_password(username)
|
7
|
+
@passwords ||= {}
|
8
|
+
unless password = @passwords[username]
|
9
|
+
password = @passwords[username] = SecureRandom.hex(12)
|
10
|
+
end
|
11
|
+
password
|
12
|
+
end
|
13
|
+
|
14
|
+
def namespace
|
15
|
+
@namespace or raise "@namespace is not initialized"
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_simple(cmd, fail_on_error=true, timeout = nil)
|
19
|
+
cmd = process_cmd(cmd)
|
20
|
+
|
21
|
+
super cmd, fail_on_error, timeout
|
22
|
+
|
23
|
+
puts stderr_from(cmd)
|
24
|
+
puts stdout_from(cmd)
|
25
|
+
end
|
26
|
+
|
27
|
+
def run_interactive(cmd)
|
28
|
+
cmd = process_cmd(cmd)
|
29
|
+
|
30
|
+
super cmd
|
31
|
+
|
32
|
+
puts stderr_from(cmd)
|
33
|
+
puts stdout_from(cmd)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Substitute the namespace for marker $ns
|
37
|
+
def unescape(string)
|
38
|
+
string = super
|
39
|
+
string.gsub("$ns", namespace)
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_process(wanted)
|
43
|
+
super wanted.gsub("$ns", namespace)
|
44
|
+
end
|
45
|
+
|
46
|
+
def tempfiles
|
47
|
+
@tempfiles||=[]
|
48
|
+
end
|
49
|
+
|
50
|
+
protected
|
51
|
+
|
52
|
+
def process_cmd(cmd)
|
53
|
+
cmd.gsub!("$ns", namespace)
|
54
|
+
cmd.gsub!("$pubkeys_url", Conjur.configuration.pubkeys_url)
|
55
|
+
|
56
|
+
@last_cmd = cmd
|
57
|
+
JsonSpec.memory.each do |k,v|
|
58
|
+
cmd.gsub!("%{#{k}}", v)
|
59
|
+
end
|
60
|
+
cmd
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
World(ConjurCLIWorld)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
module Conjur
|
22
|
+
module Asset
|
23
|
+
module TrialFactory
|
24
|
+
VERSION = "1.0.0"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
require 'conjur-asset-trial-factory-version'
|
22
|
+
require 'conjur/trial-factory-api'
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'conjur/trial'
|
23
|
+
|
24
|
+
module Conjur
|
25
|
+
class API
|
26
|
+
# List all trials
|
27
|
+
def trials
|
28
|
+
JSON.parse(trial_factory_resource.get).map do |resp|
|
29
|
+
build_trial resp
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Show a specific trial
|
34
|
+
def trial account, options = {}
|
35
|
+
resource = trial_factory_resource(account)
|
36
|
+
build_trial resource.get(params: options)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Creates a new trial
|
40
|
+
def create_trial account, email, options = {}
|
41
|
+
resp = trial_factory_resource.post({
|
42
|
+
account: account,
|
43
|
+
email: email
|
44
|
+
}.merge(options.slice(:imageid)))
|
45
|
+
build_trial resp
|
46
|
+
end
|
47
|
+
|
48
|
+
protected
|
49
|
+
|
50
|
+
def build_trial resp
|
51
|
+
resp = JSON.parse(resp) if resp.is_a?(String)
|
52
|
+
Trial.new(trial_factory_path(resp['account']), credentials).tap do |trial|
|
53
|
+
trial.attributes = resp
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def trial_factory_resource *path
|
58
|
+
RestClient::Resource.new(Conjur::API.trial_factory_asset_host, credentials)[trial_factory_path *path]
|
59
|
+
end
|
60
|
+
|
61
|
+
def trial_factory_path *args
|
62
|
+
args.map{|a| fully_escape(a)}.join('/')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
|
22
|
+
require 'conjur/trial-factory-api'
|
23
|
+
|
24
|
+
class Conjur::Command::TrialFactories < Conjur::Command
|
25
|
+
desc "Manage trials"
|
26
|
+
command :trial do |trials|
|
27
|
+
trials.desc 'Create a new trial'
|
28
|
+
trials.arg_name 'account email'
|
29
|
+
trials.command "create" do |c|
|
30
|
+
c.desc "Override the image id"
|
31
|
+
c.flag [:i, :imageid]
|
32
|
+
|
33
|
+
c.action do |global_options,options,args|
|
34
|
+
account = require_arg(args, 'account')
|
35
|
+
email = require_arg(args, 'email')
|
36
|
+
|
37
|
+
trial = api.create_trial account, email, options.slice(:imageid)
|
38
|
+
display trial
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
trials.desc 'List trials'
|
43
|
+
trials.command "list" do |c|
|
44
|
+
c.action do |global_options,options,args|
|
45
|
+
api.trials.each do |trial|
|
46
|
+
display trial
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
trials.desc 'Show details of a trial appliance, including recent usage'
|
52
|
+
trials.arg_name 'account'
|
53
|
+
trials.command "show" do |c|
|
54
|
+
c.desc "Abbreviated output"
|
55
|
+
c.switch [:s, :short]
|
56
|
+
|
57
|
+
c.action do |global_options,options,args|
|
58
|
+
account = require_arg(args, 'account')
|
59
|
+
|
60
|
+
display api.trial(account, options.slice(:short))
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
require 'conjur/api'
|
22
|
+
require 'conjur/configuration'
|
23
|
+
|
24
|
+
class Conjur::Configuration
|
25
|
+
add_option :trial_factory_url do
|
26
|
+
case env
|
27
|
+
when 'development'
|
28
|
+
"http://localhost:9292"
|
29
|
+
else
|
30
|
+
"https://trialfactory-conjur.herokuapp.com"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class Conjur::API
|
36
|
+
class << self
|
37
|
+
def trial_factory_asset_host
|
38
|
+
Conjur.configuration.trial_factory_url
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
require 'conjur/api/trial_factories'
|
data/lib/conjur/trial.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2014 Conjur Inc
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
|
+
# this software and associated documentation files (the "Software"), to deal in
|
6
|
+
# the Software without restriction, including without limitation the rights to
|
7
|
+
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
8
|
+
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
+
# subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in all
|
12
|
+
# copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
+
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
+
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
+
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
19
|
+
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
#
|
21
|
+
module Conjur
|
22
|
+
class Trial < RestClient::Resource
|
23
|
+
include HasAttributes
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: conjur-asset-trial-factory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Gilpin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
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: conjur-cli
|
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: cucumber
|
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: json_spec
|
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: aruba
|
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
|
+
description:
|
98
|
+
email:
|
99
|
+
- kgilpin@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- .conjurrc
|
105
|
+
- .gitignore
|
106
|
+
- .project
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- conjur-asset-trial-factory.gemspec
|
112
|
+
- features/create.feature
|
113
|
+
- features/support/env.rb
|
114
|
+
- features/support/hooks.rb
|
115
|
+
- features/support/world.rb
|
116
|
+
- lib/conjur-asset-trial-factory-version.rb
|
117
|
+
- lib/conjur-asset-trial-factory.rb
|
118
|
+
- lib/conjur/api/trial_factories.rb
|
119
|
+
- lib/conjur/command/trial_factories.rb
|
120
|
+
- lib/conjur/trial-factory-api.rb
|
121
|
+
- lib/conjur/trial.rb
|
122
|
+
homepage: http://github.com/conjurinc/conjur-asset-trial-factory
|
123
|
+
licenses:
|
124
|
+
- MIT
|
125
|
+
metadata: {}
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
requirements: []
|
141
|
+
rubyforge_project:
|
142
|
+
rubygems_version: 2.2.2
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Client library for managing Conjur trials.
|
146
|
+
test_files:
|
147
|
+
- features/create.feature
|
148
|
+
- features/support/env.rb
|
149
|
+
- features/support/hooks.rb
|
150
|
+
- features/support/world.rb
|
151
|
+
has_rdoc:
|