mirror of
https://github.com/internetee/registry.git
synced 2025-08-23 17:50:51 +02:00
Merge e1794d95f9
into c8a0788366
This commit is contained in:
commit
31a90e802e
6 changed files with 96 additions and 4 deletions
|
@ -19,11 +19,14 @@ module Repp
|
|||
desc 'Submit a new api user certificate signing request'
|
||||
def create
|
||||
@api_user = current_user.registrar.api_users.find(cert_params[:api_user_id])
|
||||
|
||||
csr = decode_cert_params(cert_params[:csr])
|
||||
|
||||
@certificate = @api_user.certificates.build(csr: csr)
|
||||
if csr.blank?
|
||||
@certificate.errors.add(:base, I18n.t(:crt_or_csr_must_be_present))
|
||||
return handle_non_epp_errors(@certificate)
|
||||
end
|
||||
|
||||
@certificate = @api_user.certificates.build(csr: csr)
|
||||
if @certificate.save
|
||||
notify_admins
|
||||
render_success(data: { api_user: { id: @api_user.id } })
|
||||
|
@ -69,7 +72,6 @@ module Repp
|
|||
|
||||
def decode_cert_params(csr_params)
|
||||
return if csr_params.blank?
|
||||
|
||||
return nil if csr_params[:body] == 'invalid'
|
||||
|
||||
begin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue