foreman_vault 0.4.0 → 1.0.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
  SHA256:
3
- metadata.gz: d4b3350992a46b726aea3cee25dbca26efcd09f9b7f2d539543d13662661b36b
4
- data.tar.gz: 8debbd584b231a9643563801dccb9da533b5821e70f5790f1ee80dc8065fd00f
3
+ metadata.gz: 6107c566ac8bf65dd8b0c11f2c6534d26303e781407fef11f29612d5ca77325e
4
+ data.tar.gz: ae555560613c5b4dbe17281c05c7db8df0d244f82ffd27c56785e805c7ac04da
5
5
  SHA512:
6
- metadata.gz: d21b6079acb7e9f4d2972f899a23d104f76c7c65ea72d367043d3a174f0b071f47f94702763b781d67ee48cdb0d20adbdf28a2f8ede9299ba210e800f1459549
7
- data.tar.gz: 588561b8a0ccc783e14a4c2fcff7ddb66c7d4c9f2cbef90c4eb4be4c4260aacbd24230ac8da51efc34218db793ce4faa8ee5e0abf24ddbbddbb6c1fcae4913af
6
+ metadata.gz: 3a86e4e2f4fc926c0c8ade16116830d311be2b54b00cca629465d1af4c4ecfaa84cd42614ebb8090c17b50eb92ce1f732d15969f1bbfea972e9fe489b73d12f3
7
+ data.tar.gz: 30afd42d83d3d91ce4d72fc4419cd2b0f360f495462d6e916b209db7619a63ada8a365169ec8903508aa738e9686a627bb9577b4648851bacffa8bf60b8592f5
data/README.md CHANGED
@@ -22,7 +22,8 @@ This allows Foreman to create everything needed to access Hashicorp Vault direct
22
22
 
23
23
  | Foreman Version | Plugin Version |
24
24
  | --------------- | -------------- |
25
- | >= 1.23 | ~> 0.3 |
25
+ | >= 2.3 | ~> 1.0 |
26
+ | >= 1.23 | ~> 0.3, ~> 0.4 |
26
27
  | >= 1.20 | ~> 0.2 |
27
28
 
28
29
  ## Requirements
@@ -4,10 +4,12 @@ module ForemanVault
4
4
  module ProvisioningTemplateExtensions
5
5
  extend ActiveSupport::Concern
6
6
 
7
- def render(host: nil, params: {}, variables: {}, mode: Foreman::Renderer::REAL_MODE, template_input_values: {}, source_klass: nil)
7
+ # rubocop:disable Metrics/ParameterLists
8
+ def render(renderer: Foreman::Renderer, host: nil, params: {}, variables: {}, mode: Foreman::Renderer::REAL_MODE, template_input_values: {}, source_klass: nil)
8
9
  source_klass = Foreman::Renderer::Source::Database if template_kind == TemplateKind.find_by(name: 'VaultPolicy')
9
10
 
10
11
  super
11
12
  end
13
+ # rubocop:enable Metrics/ParameterLists
12
14
  end
13
15
  end
@@ -29,7 +29,7 @@ module ForemanVault
29
29
 
30
30
  initializer 'foreman_vault.register_plugin', before: :finisher_hook do |_app|
31
31
  Foreman::Plugin.register :foreman_vault do
32
- requires_foreman '>= 1.23'
32
+ requires_foreman '>= 2.3'
33
33
 
34
34
  apipie_documented_controllers ["#{ForemanVault::Engine.root}/app/controllers/api/v2/*.rb"]
35
35
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanVault
4
- VERSION = '0.4.0'
4
+ VERSION = '1.0.0'
5
5
  end
@@ -3,6 +3,7 @@
3
3
  require 'test_plugin_helper'
4
4
 
5
5
  class VaultPolicyTemplateTest < ActiveSupport::TestCase
6
+ let(:host) { FactoryBot.create(:host, :managed) }
6
7
  let(:template) { FactoryBot.create(:provisioning_template, :vault_policy) }
7
8
 
8
9
  it 'is rendered from a database' do
@@ -12,4 +13,16 @@ class VaultPolicyTemplateTest < ActiveSupport::TestCase
12
13
 
13
14
  template.render
14
15
  end
16
+
17
+ test 'render in default mode' do
18
+ assert_nothing_raised { template.render(host: host) }
19
+ end
20
+
21
+ test 'render in safe mode' do
22
+ assert_nothing_raised { template.render(renderer: Foreman::Renderer::SafeModeRenderer, host: host) }
23
+ end
24
+
25
+ test 'render in unsafe mode' do
26
+ assert_nothing_raised { template.render(renderer: Foreman::Renderer::UnsafeModeRenderer, host: host) }
27
+ end
15
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dmTECH GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-04 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vault