added interface handler

This commit is contained in:
oleghasjanov 2025-03-14 12:17:35 +02:00
parent 4d33898856
commit 0ba69ea848
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ module Repp
api_user_id = p12_params[:api_user_id]
render_error(I18n.t('errors.messages.not_found'), :not_found) and return if api_user_id.blank?
certificate = ::Certificates::CertificateGenerator.new(api_user_id: api_user_id).execute
certificate = ::Certificates::CertificateGenerator.new(api_user_id: api_user_id, interface: 'registrar').execute
render_success(data: { certificate: certificate })
end

View file

@ -131,7 +131,7 @@ class Certificate < ApplicationRecord
cn = pc.scan(%r{\/CN=(.+)}).flatten.first
self.common_name = cn.split('/').first
self.md5 = OpenSSL::Digest::MD5.new(origin.to_der).to_s if crt
self.interface = crt ? API : REGISTRAR
self.interface = crt ? API : REGISTRAR if interface.blank?
end
def create_tempfile(filename, content = '')