Merge pull request #9601 from adullact/feature-ouidou/disable_certigna_if_not_configured
feat: add env var CERTIGNA_ENABLED to disable certigna if not used
This commit is contained in:
commit
d8b8795ce0
3 changed files with 8 additions and 0 deletions
|
@ -9,6 +9,10 @@ class Certigna::API
|
|||
end
|
||||
end
|
||||
|
||||
def self.enabled?
|
||||
ENV.fetch("CERTIGNA_ENABLED", "enabled") == "enabled"
|
||||
end
|
||||
|
||||
def self.timestamp(data)
|
||||
ensure_properly_configured!
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ class BillSignatureService
|
|||
end
|
||||
|
||||
def self.sign_operations(operations, day)
|
||||
return unless Certigna::API.enabled?
|
||||
bill = BillSignature.build_with_operations(operations, day)
|
||||
signature = Certigna::API.timestamp(bill.digest)
|
||||
bill.set_signature(signature, day)
|
||||
|
|
|
@ -14,6 +14,9 @@ DS_ENV="staging"
|
|||
# Agent Connect usage
|
||||
# AGENT_CONNECT_ENABLED="disabled" # "enabled" by default
|
||||
|
||||
# Certigna usage
|
||||
# CERTIGNA_ENABLED="disabled" # "enabled" by default
|
||||
|
||||
# Configure the maximum number of times a job is retried
|
||||
# MAX_ATTEMPTS_JOBS=25
|
||||
# MAX_ATTEMPTS_API_ENTREPRISE_JOBS=5
|
||||
|
|
Loading…
Reference in a new issue