mirror of
https://github.com/docusealco/docuseal
synced 2026-11-11 07:42:32 -05:00
adjust for multitenant
This commit is contained in:
1 parent
c904d51302
commit
f5caed502f
24 files changed
+139
-52
No files matched your search
@@ -3,6 +3,30 @@
|
||||
module Accounts
|
||||
module_function
|
||||
|
||||
def load_signing_certs(account)
|
||||
certs =
|
||||
if Docuseal.multitenant?
|
||||
Docuseal::CERTS
|
||||
else
|
||||
EncryptedConfig.find_by(account:, key: EncryptedConfig::ESIGN_CERTS_KEY).value
|
||||
end
|
||||
|
||||
{
|
||||
cert: OpenSSL::X509::Certificate.new(certs['cert']),
|
||||
key: OpenSSL::PKey::RSA.new(certs['key']),
|
||||
sub_ca: OpenSSL::X509::Certificate.new(certs['sub_ca']),
|
||||
sub_key: OpenSSL::PKey::RSA.new(certs['sub_key']),
|
||||
root_ca: OpenSSL::X509::Certificate.new(certs['root_ca']),
|
||||
root_key: OpenSSL::PKey::RSA.new(certs['root_key'])
|
||||
}
|
||||
end
|
||||
|
||||
def can_send_emails?(account)
|
||||
return true if Docuseal.multitenant?
|
||||
|
||||
EncryptedConfig.exists?(account_id: account.id, key: EncryptedConfig::EMAIL_SMTP_KEY)
|
||||
end
|
||||
|
||||
def normalize_timezone(timezone)
|
||||
tzinfo = TZInfo::Timezone.get(ActiveSupport::TimeZone::MAPPING[timezone] || timezone)
|
||||
|
||||
|
||||
Reference in new issue
Block a user