conjur-asset-trial-factory 1.0.0 → 1.1.0

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: 4d79edef84ceea93fcb0dc362496b8822a6f4d8a
4
- data.tar.gz: e23dd119995cc943d76c703fa179f2e65b02389f
3
+ metadata.gz: c5c9264a9b78cb609a9f16e5ca6ac2b50ee187da
4
+ data.tar.gz: e9d1b464d490ca361050b824e8ba47715d9555e3
5
5
  SHA512:
6
- metadata.gz: ab6162bb5aba8f8bb11b87b43972b4fcff8b3495815ef5ebb99756c68b9a87ec10574112ed57cd67dacd4826471fa583121bc2b4a3153572b7144adcc2b4296a
7
- data.tar.gz: 0897c07485bcb3313d6a4c9478ce22bf2a4f098a857cb21ac9b2952dfcf89ed3a25b92c0332ced295698373d0cb7c276c2946def0c11117af96501c9131ca84a
6
+ metadata.gz: a19b84a5afe9be824f135ddf3c6b44e98489fd0dc6469511c78175995a4d97ae422bd241524474c137bed5d458ea9b3cc71aed43aa242a970bad8a260f2d87a1
7
+ data.tar.gz: eb4b2d71b6f936325ba41d1ed0394333d14c953689e5f42a12cbdcdcff6bb265774b00b56fb7b957775925db246a98b77d1b8a926919c9ba32a92d033fed16a3
data/.conjurrc CHANGED
@@ -1,3 +1,5 @@
1
1
  account: conjurops
2
+ appliance_url: https://conjur-master.itp.conjur.net/api
3
+ cert_file: /Users/kgilpin/accounts/conjurops/conjur-conjurops.pem
2
4
  plugins:
3
5
  - trial-factory
@@ -0,0 +1,4 @@
1
+ # 1.1.0
2
+
3
+ * Change output of the `list` command to be well-formed JSON
4
+ * Added `stale` command to list trials which are more than 30 days old, and have no activity
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Conjur::Asset::Trial::Factory
1
+ # Conjur trial factory
2
2
 
3
- TODO: Write a gem description
3
+ Used to launch and manage trials.
4
4
 
5
5
  ## Installation
6
6
 
@@ -21,7 +21,7 @@
21
21
  module Conjur
22
22
  module Asset
23
23
  module TrialFactory
24
- VERSION = "1.0.0"
24
+ VERSION = "1.1.0"
25
25
  end
26
26
  end
27
27
  end
@@ -42,9 +42,33 @@ class Conjur::Command::TrialFactories < Conjur::Command
42
42
  trials.desc 'List trials'
43
43
  trials.command "list" do |c|
44
44
  c.action do |global_options,options,args|
45
- api.trials.each do |trial|
46
- display trial
45
+ puts JSON.pretty_generate(api.trials)
46
+ end
47
+ end
48
+
49
+ trials.desc 'Show trials which are at least 30 days old, and have no activity'
50
+ trials.command "stale" do |c|
51
+ c.action do |global_options,options,args|
52
+ require 'time'
53
+ ago = Time.now - 30.days
54
+ trials = api.trials
55
+ found = 0
56
+ puts "[\n"
57
+ trials.each do |t|
58
+ account = t.attributes['account']
59
+ contact = t.attributes['contact']
60
+ info = api.trial(account, short: true)
61
+ launch_time = Time.parse(info.attributes['instance']['launch_time'])
62
+ if launch_time < ago && info.attributes['activity']['count'] == 0
63
+ if found != 0
64
+ $stdout.write ",\n"
65
+ end
66
+ $stdout.write " "
67
+ $stdout.write JSON.generate([ account, contact ])
68
+ found += 1
69
+ end
47
70
  end
71
+ puts "\n]"
48
72
  end
49
73
  end
50
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-asset-trial-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-19 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,6 +104,7 @@ files:
104
104
  - .conjurrc
105
105
  - .gitignore
106
106
  - .project
107
+ - CHANGELOG.md
107
108
  - Gemfile
108
109
  - LICENSE.txt
109
110
  - README.md