Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 45bf8d73 authored by Kamil Trzciński's avatar Kamil Trzciński
Browse files

Merge branch 'ce-jej/group-saml-metadata-endpoint' into 'master'

[CE] Backport TokenAuthenticatable comparison method and stub_default_url_options

See merge request gitlab-org/gitlab-ce!19094
......@@ -53,6 +53,11 @@ def add_authentication_token_field(token_field, options = {})
define_method("reset_#{token_field}!") do
strategy.reset_token!(self)
end
define_method("#{token_field}_matches?") do |other_token|
token = read_attribute(token_field)
token.present? && ActiveSupport::SecurityUtils.variable_size_secure_compare(other_token, token)
end
end
end
end
......@@ -27,6 +27,11 @@ def stub_config_setting(messages)
allow(Gitlab.config.gitlab).to receive_messages(to_settings(messages))
end
def stub_default_url_options(host: "localhost", protocol: "http")
url_options = { host: host, protocol: protocol }
allow(Rails.application.routes).to receive(:default_url_options).and_return(url_options)
end
def stub_gravatar_setting(messages)
allow(Gitlab.config.gravatar).to receive_messages(to_settings(messages))
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment