diff options
Diffstat (limited to 'app/models/x509_issuer.rb')
-rw-r--r-- | app/models/x509_issuer.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/x509_issuer.rb b/app/models/x509_issuer.rb index 81491d8e507..769d56a9838 100644 --- a/app/models/x509_issuer.rb +++ b/app/models/x509_issuer.rb @@ -6,13 +6,16 @@ class X509Issuer < ApplicationRecord # rfc 5280 - 4.2.1.1 Authority Key Identifier validates :subject_key_identifier, presence: true, format: { with: Gitlab::Regex.x509_subject_key_identifier_regex } # rfc 5280 - 4.1.2.4 Issuer - validates :subject, presence: true # rfc 5280 - 4.2.1.13 CRL Distribution Points # cRLDistributionPoints extension using URI:http - validates :crl_url, presence: true, public_url: true + validates :crl_url, allow_nil: true, public_url: true def self.safe_create!(attributes) create_with(attributes) .safe_find_or_create_by!(subject_key_identifier: attributes[:subject_key_identifier]) end + + def self.with_crl_url + where.not(crl_url: nil) + end end |