URL-encode AES256 secret as query param
This commit is contained in:
parent
8779f34f98
commit
9c7408d6a2
3 changed files with 7 additions and 4 deletions
|
@ -35,9 +35,10 @@ class Staffs::X509CertificatesController < ApplicationController
|
||||||
result = CreateRSAKeysAndX509SelfSignedCertificate.call \
|
result = CreateRSAKeysAndX509SelfSignedCertificate.call \
|
||||||
@x509_certificate_form.attributes
|
@x509_certificate_form.attributes
|
||||||
|
|
||||||
return render :new unless result.success?
|
redirect_to staff_x509_certificate_url(
|
||||||
|
result.certificate,
|
||||||
redirect_to [:staff, result.certificate]
|
private_key_secret: Base64.urlsafe_encode64(result.private_key_pem_key),
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -26,6 +26,7 @@ module Partynest
|
||||||
confirmation_token
|
confirmation_token
|
||||||
password
|
password
|
||||||
password_confirmation
|
password_confirmation
|
||||||
|
private_key_secret
|
||||||
reset_password_token
|
reset_password_token
|
||||||
secret
|
secret
|
||||||
unlock_token
|
unlock_token
|
||||||
|
|
|
@ -58,7 +58,8 @@ RSpec.describe 'POST /staff/x509_certificates' do
|
||||||
before { make_request }
|
before { make_request }
|
||||||
|
|
||||||
specify do
|
specify do
|
||||||
expect(response).to redirect_to [:staff, X509Certificate.last]
|
expect(response).to \
|
||||||
|
redirect_to(/\A#{staff_x509_certificate_url(X509Certificate.last)}\?/)
|
||||||
end
|
end
|
||||||
|
|
||||||
specify do
|
specify do
|
||||||
|
|
Reference in a new issue