5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 08:36:22 +00:00

feat: generar la llave privada #14169
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2023-08-29 17:49:25 -03:00
parent d96de873a7
commit 99f8947c43

View file

@ -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