Skip to content

Commit bd6e248

Browse files
committed
fix(snis): Set up instructions for deck
Snis need to be nested inside certificates and certificates require the key and cert when using deck (even if it exists).
1 parent 9cd5938 commit bd6e248

File tree

1 file changed

+7
-0
lines changed
  • app/_plugins/drops/entity_example/presenters

1 file changed

+7
-0
lines changed

app/_plugins/drops/entity_example/presenters/deck.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class Base < Presenters::Base # rubocop:disable Style/Documentation
1313
def entity
1414
@entity ||= if @example_drop.entity_type == 'target'
1515
'upstreams'
16+
elsif @example_drop.entity_type == 'sni'
17+
'certificates'
1618
else
1719
"#{@example_drop.entity_type}s"
1820
end
@@ -44,6 +46,11 @@ def missing_variables
4446
def _data
4547
if @example_drop.entity_type == 'target'
4648
{ 'name' => 'example_upstream', 'targets' => [@example_drop.data] }
49+
elsif @example_drop.entity_type == 'sni'
50+
{ 'id' => @example_drop.data.dig('certificate', 'id'),
51+
'cert' => "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----",
52+
'key' => "-----BEGIN RSA PRIVATE KEY-----\n-----END RSA PRIVATE KEY",
53+
'snis' => [@example_drop.data.except('certificate')] }
4754
else
4855
@example_drop.data
4956
end

0 commit comments

Comments
 (0)