Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions src/spec/assets/sandbox/director_test.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,8 @@ user_management:
uaa:
symmetric_key: uaa-secret-key
# public key of `uaa.jwt.policy.keys.key1.signingKey` from src/spec/assets/uaa_config/asymmetric/uaa.yml
# To Generate:
# openssl rsa -pubout -in <(yq .uaa.jwt.policy.keys.key1.signingKey src/spec/assets/uaa_config/asymmetric/uaa.yml)
public_key: |
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA06hlEn4/NMWtnele3C5j
PZm3P55/9jppIQXF/BP0OGaAMoRNZEafv6nH1b8btc4zs0dx52Y7xmOpeRqnXDeD
3E2uTW0tgjsLQU8BbjlXRrKkzvUiYZqkaCkCMxcX5OcBvhT4Km+/1u4AGuFq9sS2
Pdv+IAWEOsYbJjPl3lZn2uiQCCX5P5z5JkGbQ/7mBSi/ja1SogP1MBzRLf6VyHpE
q7zvVnfm+oBsvPu2RC0EM14kL/TktQwyAvpL4TWunhE7gAh4j0fMNgmBfW9NG328
E2+i+1ag+WyFzSy0rJQHgV0ImEtjhmj0E0C1ysI4Fpy5gew0ZrtsFwnXcKV39xMS
EG3JLzV3h+QZ4BS9nBi/G8lLF3bWO/B0WTuYDWdkLm1ng3K/Oz0KhVkVG5Igu9FD
k6EkD62SsMYUMl++3/EMrtNxxvJQDSOOf59/o3BQplbl6qOG6Mpji3ZggxyRYgRS
iC7PPqJAKYrP3zCzeXyQEMMYxuOcmRR3W6aY341v+9Hs4w+zNJZ2DnB+r6Jaqhpi
sSiu1yzT0nzkesdv47UNLaTkt0fFMbnvkUSvtz3ZRK5MqVAgjBMULqobz5ASPPe0
RBg7V6023PHtyNxsJpxsobRG2aril4+7OOspiWSHIuoV1vm1IDs2utHak0GHY0Nc
MBYj/GcsUXZhHBDbjHk07IsCAwEAAQ==
-----END PUBLIC KEY-----
<%= uaa_jwt_public_key.strip.split("\n").map { |l| " #{l}" }.join("\n") %>
url: <%= uaa_url %>
<% else %>
local:
Expand Down Expand Up @@ -156,6 +141,8 @@ config_server:
client_id: <%= config_server_uaa_client_id %>
client_secret: <%= config_server_uaa_client_secret %>
ca_cert_path: <%= config_server_uaa_ca_cert_path %>
public_key: |
<%= uaa_jwt_public_key.strip.split("\n").map { |l| " #{l}" }.join("\n") %>
<% end %>

generate_vm_passwords: <%= generate_vm_passwords %>
Expand Down
2 changes: 2 additions & 0 deletions src/spec/assets/sandbox/health_monitor.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ director: &director
client_id: hm
client_secret: secret
director_ca_cert: <%= certificate_path %>
uaa_public_key: |
<%= uaa_jwt_public_key.strip.split("\n").map { |l| " #{l}" }.join("\n") %>

intervals:
poll_director: 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ director: &director
client_id: hm
client_secret: secret
director_ca_cert: <%= certificate_path %>
uaa_public_key: |
<%= uaa_jwt_public_key.strip.split("\n").map { |l| " #{l}" }.join("\n") %>

intervals:
poll_director: 5
Expand Down
3 changes: 2 additions & 1 deletion src/spec/integration_support/config_server_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def initialize(sandbox, logger)
'client_id' => sandbox.director_config.config_server_uaa_client_id,
'client_secret' => sandbox.director_config.config_server_uaa_client_secret,
'url' => sandbox.director_config.config_server_uaa_url,
'ca_cert_path' => sandbox.director_config.config_server_uaa_ca_cert_path
'ca_cert_path' => sandbox.director_config.config_server_uaa_ca_cert_path,
'public_key' => sandbox.director_config.uaa_jwt_public_key
}
end

Expand Down
8 changes: 8 additions & 0 deletions src/spec/integration_support/director_config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'yaml'
require 'integration_support/constants'
require 'integration_support/uaa_service'

Expand Down Expand Up @@ -110,6 +111,13 @@ def initialize(attrs, port_provider)
@keep_unreachable_vms = attrs.fetch(:keep_unreachable_vms, false)
end

def uaa_jwt_public_key
@uaa_jwt_public_key ||= YAML.load_file(
File.join(IntegrationSupport::Constants::BOSH_REPO_SRC_DIR,
'spec', 'assets', 'uaa_config', 'asymmetric', 'uaa.yml'),
).dig('uaa', 'jwt', 'policy', 'keys', 'key1', 'publicKey')
end

def render(template_path)
template_contents = File.read(template_path)
template = ERB.new(template_contents)
Expand Down
4 changes: 4 additions & 0 deletions src/spec/integration_support/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,10 @@ def uaa_ca_cert_path
IntegrationSupport::UaaService::ROOT_CERT
end

def uaa_jwt_public_key
@uaa_jwt_public_key ||= director_config.uaa_jwt_public_key
end

Comment thread
coderabbitai[bot] marked this conversation as resolved.
attr_reader :director_tmp_path, :task_logs_dir
end
end
Expand Down
Loading