Skip to content

Commit

Permalink
cert service doesn't need identity info
Browse files Browse the repository at this point in the history
  • Loading branch information
suprjinx committed Aug 22, 2024
1 parent 45b3195 commit ecbd4eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/lib/services/certificate_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion app/lib/services/vault_service.rb
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit ecbd4eb

Please sign in to comment.