mirror of
https://github.com/internetee/registry.git
synced 2025-08-16 06:23:57 +02:00
feat: Implement P12 certificate generation improvements
- Replace hardcoded P12 password with randomly generated one - Add p12_password column to certificates table - Update certificate serializer to include p12 password in response - Remove deprecated certificate revocation logic - Add tests for certificate revocation functionality - Implement async P12 generation via Sidekiq job - Add job uniqueness to prevent parallel certificate generation Migration changes: - Replace p12_password_digest with p12_password column - Add safety measures for column removal
This commit is contained in:
parent
072f4440e2
commit
ae96863b88
13 changed files with 157 additions and 64 deletions
25
test/jobs/p12_generator_job_test.rb
Normal file
25
test/jobs/p12_generator_job_test.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'test_helper'
|
||||
|
||||
class P12GeneratorJobTest < ActiveJob::TestCase
|
||||
test "ensures only one job runs at a time" do
|
||||
Sidekiq::Testing.inline!
|
||||
|
||||
api_user = users(:api_bestnames)
|
||||
|
||||
thread1 = Thread.new do
|
||||
P12GeneratorJob.perform_later(api_user.id)
|
||||
end
|
||||
|
||||
sleep(2)
|
||||
|
||||
thread2 = Thread.new do
|
||||
P12GeneratorJob.perform_later(api_user.id)
|
||||
end
|
||||
|
||||
thread1.join
|
||||
thread2.join
|
||||
|
||||
ensure
|
||||
Sidekiq::Testing.fake!
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue