From ecbd4ebb63ef6a560a34c0b94994994d4affd7b0 Mon Sep 17 00:00:00 2001 From: Geoff Wilson Date: Thu, 22 Aug 2024 15:15:30 -0400 Subject: [PATCH] cert service doesn't need identity info --- app/lib/services/certificate_service.rb | 4 ++-- app/lib/services/vault_service.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/lib/services/certificate_service.rb b/app/lib/services/certificate_service.rb index c30ea06..3b63dfa 100644 --- a/app/lib/services/certificate_service.rb +++ b/app/lib/services/certificate_service.rb @@ -5,8 +5,8 @@ def initialize @impl = VaultService.new end - def get_cert_for(identity, cert_issue_request) - @impl.get_cert_for(identity, cert_issue_request) + def issue_cert(cert_issue_request) + @impl.issue_cert(cert_issue_request) end end end diff --git a/app/lib/services/vault_service.rb b/app/lib/services/vault_service.rb index 5b032d3..efb2381 100644 --- a/app/lib/services/vault_service.rb +++ b/app/lib/services/vault_service.rb @@ -1,13 +1,14 @@ module Services class VaultService def initialize + # TODO create a new token for use in the session @client = Vault::Client.new( address: Rails.application.config.astral[:vault_addr], token: Rails.application.config.astral[:vault_token] ) end - def get_cert_for(identity, cert_issue_request) + def issue_cert(cert_issue_request) # Generate the TLS certificate using the intermediate CA tls_cert = @client.logical.write(Rails.application.config.astral[:vault_cert_path], common_name: cert_issue_request.common_name,