diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-29 19:28:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-29 19:28:51 +0300 |
commit | e3861b44c8e6d23a5b5fae6e3adad0fd8f3950e0 (patch) | |
tree | b289bac2db8b72760a20026429e722fd3e7591de /app | |
parent | 539af4e961fe1414c93a31fc01fb4b9e18c3ed33 (diff) |
Add latest changes from gitlab-org/security/gitlab@16-5-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/models/pages_domain.rb | 5 | ||||
-rw-r--r-- | app/policies/issue_policy.rb | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index b86bc761cc1..08326cf39e6 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -33,10 +33,11 @@ class PagesDomain < ApplicationRecord validates :verification_code, presence: true, allow_blank: false validate :validate_pages_domain + validate :max_certificate_key_length, if: ->(domain) { domain.key.present? } validate :validate_matching_key, if: ->(domain) { domain.certificate.present? || domain.key.present? } - validate :validate_intermediates, if: ->(domain) { domain.certificate.present? && domain.certificate_changed? } + # validate_intermediates must run after key validations to skip expensive SSL validation when there is a key error + validate :validate_intermediates, if: ->(domain) { domain.certificate.present? && domain.certificate_changed? && errors[:key].blank? } validate :validate_custom_domain_count_per_project, on: :create - validate :max_certificate_key_length, if: ->(domain) { domain.key.present? } attribute :auto_ssl_enabled, default: -> { ::Gitlab::LetsEncrypt.enabled? } attribute :wildcard, default: false diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb index 6114785a851..1fd77f2a235 100644 --- a/app/policies/issue_policy.rb +++ b/app/policies/issue_policy.rb @@ -57,7 +57,10 @@ class IssuePolicy < IssuablePolicy prevent :read_issue end - rule { ~can?(:read_issue) }.prevent :create_note + rule { ~can?(:read_issue) }.policy do + prevent :create_note + prevent :award_emoji + end rule { locked }.policy do prevent :reopen_issue |