hieraviz 0.2.4 → 0.2.6

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
- SHA1:
3
- metadata.gz: 696d61009ddd71002471a1ea73f2ae29cc852c83
4
- data.tar.gz: 5a47b70c375793428efd086105b6a23cafff17bb
2
+ SHA256:
3
+ metadata.gz: 9bac3af0637b03cc817afa615fc23438e7a69d80d5b878206874b947e7679148
4
+ data.tar.gz: 2a2936df0f3b6446b57c9d62b8420c2b678ab8352ba9f8c06fc2e66a5437b5c2
5
5
  SHA512:
6
- metadata.gz: 3db49fea1e8d1bc172d2ef989624c299f06550a78689f5e074f5544c9e96677781f9299310040a87bf4835d94495916f7bb352ddd3a599a2d55fc1752c0862a2
7
- data.tar.gz: d4c90394a44814599169f3d7e14f6734e7949b494ca14106320b56700475249f8fba17f35a0cfa18d18d9c287bed19f117e20d43273925d424224b2c7d9e15c4
6
+ metadata.gz: 955b562b5915e2b7817522794a308a786c995afded7b3735aaea2a48c006d411704032798ec90738072d37f1e89a47d632998409c3c9a8f52ae880d8dd55c1c6
7
+ data.tar.gz: 3781dbfab5fb417ebeb313a8ed3654d6c199c72ffe0bbf8d8ca4a725024cca1b7c9ac3d5a2a00f9af7990b9778ca0a9fead026a35821fcc3f45651dee809203e
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  Hieraviz Changelog
2
2
  ========================
3
3
 
4
+ ### v0.2.6 - 2018-01-27
5
+ - security update on yajl-ruby
6
+ - update new regexps due to mustermann upgarde
7
+
8
+ ### v0.2.5 - 2016-12-30
9
+ - update hieracles lib
10
+
4
11
  ### v0.2.4 - 2016-04-29
5
12
  - fix the dynamic changes of puppet directories
6
13
 
data/app/apiv1.rb CHANGED
@@ -74,74 +74,81 @@ module HieravizApp
74
74
  200
75
75
  end
76
76
 
77
- get %r{^/?([-_\.a-zA-Z0-9]+)?/nodes} do |base|
77
+ get %r{/?([-_\.a-zA-Z0-9]+)?/nodes} do |base|
78
78
  check_authorization
79
79
  hieracles_config = prepare_config(base)
80
80
  json Hieracles::Registry.nodes(hieracles_config)
81
81
  end
82
82
 
83
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/info} do |base, node|
83
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/info} do |base, node|
84
84
  check_authorization
85
85
  hieracles_config = prepare_config(base)
86
86
  node = Hieracles::Node.new(node, hieracles_config)
87
87
  json node.info
88
88
  end
89
89
 
90
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/params} do |base, node|
90
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/params} do |base, node|
91
91
  check_authorization
92
92
  hieracles_config = prepare_config(base, node)
93
93
  node = Hieracles::Node.new(node, hieracles_config)
94
94
  json node.params
95
95
  end
96
96
 
97
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/allparams} do |base, node|
97
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/allparams} do |base, node|
98
98
  check_authorization
99
99
  hieracles_config = prepare_config(base, node)
100
100
  node = Hieracles::Node.new(node, hieracles_config)
101
101
  json node.params(false)
102
102
  end
103
103
 
104
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
104
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
105
105
  check_authorization
106
106
  facts = get_facts(base, node)
107
107
  json facts.read
108
108
  end
109
109
 
110
- post %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
110
+ post %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
111
111
  check_authorization
112
112
  facts = get_facts(base, node)
113
113
  data = JSON.parse(request.body.read.to_s)
114
114
  json facts.write(data)
115
115
  end
116
116
 
117
- delete %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
117
+ delete %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/facts} do |base, node|
118
118
  check_authorization
119
119
  facts = get_facts(base, node)
120
120
  json facts.remove
121
121
  end
122
122
 
123
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)$} do |base, node|
123
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)} do |base, node|
124
124
  check_authorization
125
125
  hieracles_config = prepare_config(base, node)
126
126
  node = Hieracles::Node.new(node, hieracles_config)
127
127
  json node.params
128
128
  end
129
129
 
130
- get %r{^/?([-_\.a-zA-Z0-9]+)?/farms} do |base|
130
+ get %r{/?([-_\.a-zA-Z0-9]+)?/farms} do |base|
131
131
  check_authorization
132
132
  cross_origin
133
133
  hieracles_config = prepare_config(base)
134
134
  json Hieracles::Registry.farms_counted(hieracles_config, base, true)
135
135
  end
136
136
 
137
- get %r{^/?([-_\.a-zA-Z0-9]+)?/vars} do |base|
137
+ get %r{/?([-_\.a-zA-Z0-9]+)?/modules} do |base|
138
+ check_authorization
139
+ cross_origin
140
+ hieracles_config = prepare_config(base)
141
+ json Hieracles::Registry.modules(hieracles_config, base, true)
142
+ end
143
+
144
+ get %r{/?([-_\.a-zA-Z0-9]+)?/vars} do |base|
138
145
  check_authorization
139
146
  hieracles_config = prepare_config(base)
140
147
  hiera = Hieracles::Hiera.new(hieracles_config)
141
148
  json hiera.params
142
149
  end
143
150
 
144
- get %r{^/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/hierarchy} do |base, node|
151
+ get %r{/?([-_\.a-zA-Z0-9]+)?/node/([-_\.a-zA-Z0-9]+)/hierarchy} do |base, node|
145
152
  check_authorization
146
153
  hieracles_config = prepare_config(base, node)
147
154
  hiera = Hieracles::Hiera.new(hieracles_config)
@@ -158,10 +165,11 @@ module HieravizApp
158
165
  json res
159
166
  end
160
167
 
161
- get %r{^/?([-_\.a-zA-Z0-9]+)?/farm/([-_\.a-zA-Z0-9]+)$} do |base, farm|
168
+ get %r{/?([-_\.a-zA-Z0-9]+)?/farm/([-_\.a-zA-Z0-9]+)} do |base, farm|
162
169
  # check_authorization
163
170
  cross_origin
164
171
  hieracles_config = prepare_config(base)
172
+ Hieracles::Registry.reload_nodes
165
173
  nodes = Hieracles::Registry.nodes_parameters(hieracles_config, base).each_with_object({}) do |(key, val), acc|
166
174
  acc[key] = val if val['farm'] == farm
167
175
  end
@@ -89,7 +89,8 @@ function end_wait(meat) {
89
89
 
90
90
  function update_footer(path) {
91
91
  var debug = document.querySelector('.foot .debug');
92
- debug.innerHTML = "curl -s http://" + window.location.host + path + " | jq '.'";
92
+ console.log(window.location);
93
+ debug.innerHTML = "curl -ks " + window.location.origin + path + " | jq '.'";
93
94
  }
94
95
 
95
96
 
data/app/web.rb CHANGED
@@ -127,40 +127,40 @@ module HieravizApp
127
127
  end
128
128
  end
129
129
 
130
- get %r{^/?([-_\.a-zA-Z0-9]+)?/nodes} do |base|
130
+ get %r{/?([-_\.a-zA-Z0-9]+)?/nodes} do |base|
131
131
  @username = check_authorization
132
132
  hieracles_config = prepare_config(base)
133
133
  @nodes = Hieracles::Registry.nodes(hieracles_config)
134
134
  erb :nodes
135
135
  end
136
136
 
137
- get %r{^/?([-_\.a-zA-Z0-9]+)?/farms} do |base|
137
+ get %r{/?([-_\.a-zA-Z0-9]+)?/farms} do |base|
138
138
  @username = check_authorization
139
139
  hieracles_config = prepare_config(base)
140
140
  @farms = Hieracles::Registry.farms_counted(hieracles_config, base)
141
141
  erb :farms
142
142
  end
143
143
 
144
- get %r{^/?([-_\.a-zA-Z0-9]+)?/modules} do |base|
144
+ get %r{/?([-_\.a-zA-Z0-9]+)?/modules} do |base|
145
145
  prepare_config(base)
146
146
  @username = check_authorization
147
147
  erb :modules
148
148
  end
149
149
 
150
- get %r{^/?([-_\.a-zA-Z0-9]+)?/resources} do |base|
150
+ get %r{/?([-_\.a-zA-Z0-9]+)?/resources} do |base|
151
151
  prepare_config(base)
152
152
  @username = check_authorization
153
153
  erb :resources
154
154
  end
155
155
 
156
- get %r{^/?([-_\.a-zA-Z0-9]+)?/user} do |base|
156
+ get %r{/?([-_\.a-zA-Z0-9]+)?/user} do |base|
157
157
  prepare_config(base)
158
158
  @username = check_authorization
159
159
  @userinfo = session[:access_token] ? userinfo : {}
160
160
  erb :user
161
161
  end
162
162
 
163
- get %r{^/([-_\.a-zA-Z0-9]+)$} do |base|
163
+ get %r{/([-_\.a-zA-Z0-9]+)} do |base|
164
164
  prepare_config(base)
165
165
  @username = username
166
166
  erb :home
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hieraviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-29 00:00:00.000000000 Z
11
+ date: 2018-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.3.6
103
+ version: 0.4.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.3.6
110
+ version: 0.4.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bundler
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -248,6 +248,20 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: rack-test
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
251
265
  description: |-
252
266
  Simple web application for accessing Puppet development code
253
267
  and production data in a unified interface. Its main goal is
@@ -351,36 +365,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
351
365
  version: '0'
352
366
  requirements: []
353
367
  rubyforge_project:
354
- rubygems_version: 2.4.8
368
+ rubygems_version: 2.7.3
355
369
  signing_key:
356
370
  specification_version: 4
357
371
  summary: Web and API server for accessing Puppet dev and prod data.
358
372
  test_files:
359
373
  - spec/oauth2_helper.rb
360
- - spec/spec_helper.rb
361
- - spec/app/web_dummy_auth_spec.rb
362
- - spec/app/apiv1_spec.rb
363
- - spec/app/web_spec.rb
364
- - spec/files/config_gitlab.yml
365
- - spec/files/config_multi.yml
366
- - spec/files/hiera.yml
367
374
  - spec/files/config_dummy.yml
375
+ - spec/files/hiera.yml
368
376
  - spec/files/config.yml
369
- - spec/files/puppet/params/common/common.yaml
370
- - spec/files/puppet/params/nodes/node1.example.com.yaml
371
- - spec/files/puppet/enc/node1.example.com.yaml
372
- - spec/files/puppet/farm_modules/farm1/manifests/init.pp
373
- - spec/files/puppet/modules/module1/init.pp
374
- - spec/files/puppet/hiera.yml
375
- - spec/files/puppet2/params/common/common.yaml
376
- - spec/files/puppet2/params/nodes/node1.example.com.yaml
377
- - spec/files/puppet2/enc/node1.example.com.yaml
378
377
  - spec/files/puppet2/farm_modules/farm1/manifests/init.pp
379
- - spec/files/puppet2/modules/module1/init.pp
380
378
  - spec/files/puppet2/hiera.yml
381
- - spec/sinatra_helper.rb
379
+ - spec/files/puppet2/enc/node1.example.com.yaml
380
+ - spec/files/puppet2/params/nodes/node1.example.com.yaml
381
+ - spec/files/puppet2/params/common/common.yaml
382
+ - spec/files/puppet2/modules/module1/init.pp
383
+ - spec/files/config_gitlab.yml
384
+ - spec/files/config_multi.yml
385
+ - spec/files/puppet/farm_modules/farm1/manifests/init.pp
386
+ - spec/files/puppet/hiera.yml
387
+ - spec/files/puppet/enc/node1.example.com.yaml
388
+ - spec/files/puppet/params/nodes/node1.example.com.yaml
389
+ - spec/files/puppet/params/common/common.yaml
390
+ - spec/files/puppet/modules/module1/init.pp
391
+ - spec/spec_helper.rb
382
392
  - spec/lib/auth_gitlab_spec.rb
383
- - spec/lib/puppetdb_spec.rb
384
393
  - spec/lib/config_spec.rb
385
- - spec/lib/facts_spec.rb
386
394
  - spec/lib/store_spec.rb
395
+ - spec/lib/facts_spec.rb
396
+ - spec/lib/puppetdb_spec.rb
397
+ - spec/sinatra_helper.rb
398
+ - spec/app/web_spec.rb
399
+ - spec/app/web_dummy_auth_spec.rb
400
+ - spec/app/apiv1_spec.rb