mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 08:46:21 +00:00
feat: generar la llave privada #14169
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
d96de873a7
commit
99f8947c43
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,17 @@ class Site
|
||||||
|
|
||||||
included do
|
included do
|
||||||
encrypts :private_key_pem
|
encrypts :private_key_pem
|
||||||
|
|
||||||
|
before_save :generate_private_key_pem!, unless: :private_key_pem?
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
# Genera la llave privada y la almacena
|
||||||
|
#
|
||||||
|
# @return [nil]
|
||||||
|
def generate_private_key_pem!
|
||||||
|
self.private_key_pem ||= DistributedPress::V1::Social::Client.new(public_key_url: nil, key_size: 2048).private_key.export
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue