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,