Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 14:59:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 14:59:07 +0300
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /lib/api/internal
parent4b1de649d0168371549608993deac953eb692019 (diff)
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/api/internal')
-rw-r--r--lib/api/internal/base.rb4
-rw-r--r--lib/api/internal/kubernetes.rb6
-rw-r--r--lib/api/internal/pages.rb43
3 files changed, 29 insertions, 24 deletions
diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb
index 61ef1d5bde0..332f2f1986f 100644
--- a/lib/api/internal/base.rb
+++ b/lib/api/internal/base.rb
@@ -300,7 +300,7 @@ module API
post '/two_factor_otp_check', feature_category: :authentication_and_authorization do
status 200
- break { success: false } unless Feature.enabled?(:two_factor_for_cli)
+ break { success: false, message: 'Feature flag is disabled' } unless Feature.enabled?(:two_factor_for_cli)
actor.update_last_used_at!
user = actor.user
@@ -316,6 +316,8 @@ module API
otp_validation_result = ::Users::ValidateOtpService.new(user).execute(params.fetch(:otp_attempt))
if otp_validation_result[:status] == :success
+ ::Gitlab::Auth::Otp::SessionEnforcer.new(actor.key).update_session
+
{ success: true }
else
{ success: false, message: 'Invalid OTP' }
diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb
index d4690709de4..73723a96401 100644
--- a/lib/api/internal/kubernetes.rb
+++ b/lib/api/internal/kubernetes.rb
@@ -85,9 +85,7 @@ module API
get '/project_info' do
project = find_project(params[:id])
- # TODO sort out authorization for real
- # https://gitlab.com/gitlab-org/gitlab/-/issues/220912
- unless Ability.allowed?(nil, :download_code, project)
+ unless Guest.can?(:download_code, project) || agent.has_access_to?(project)
not_found!
end
@@ -123,3 +121,5 @@ module API
end
end
end
+
+API::Internal::Kubernetes.prepend_if_ee('EE::API::Internal::Kubernetes')
diff --git a/lib/api/internal/pages.rb b/lib/api/internal/pages.rb
index 690f52d89f3..8eaeeae26c2 100644
--- a/lib/api/internal/pages.rb
+++ b/lib/api/internal/pages.rb
@@ -32,26 +32,29 @@ module API
requires :host, type: String, desc: 'The host to query for'
end
get "/" do
- serverless_domain_finder = ServerlessDomainFinder.new(params[:host])
- if serverless_domain_finder.serverless?
- # Handle Serverless domains
- serverless_domain = serverless_domain_finder.execute
- no_content! unless serverless_domain
-
- virtual_domain = Serverless::VirtualDomain.new(serverless_domain)
- no_content! unless virtual_domain
-
- present virtual_domain, with: Entities::Internal::Serverless::VirtualDomain
- else
- # Handle Pages domains
- host = Namespace.find_by_pages_host(params[:host]) || PagesDomain.find_by_domain_case_insensitive(params[:host])
- no_content! unless host
-
- virtual_domain = host.pages_virtual_domain
- no_content! unless virtual_domain
-
- present virtual_domain, with: Entities::Internal::Pages::VirtualDomain
- end
+ ##
+ # Serverless domain proxy has been deprecated and disabled as per
+ # https://gitlab.com/gitlab-org/gitlab-pages/-/issues/467
+ #
+ # serverless_domain_finder = ServerlessDomainFinder.new(params[:host])
+ # if serverless_domain_finder.serverless?
+ # # Handle Serverless domains
+ # serverless_domain = serverless_domain_finder.execute
+ # no_content! unless serverless_domain
+ #
+ # virtual_domain = Serverless::VirtualDomain.new(serverless_domain)
+ # no_content! unless virtual_domain
+ #
+ # present virtual_domain, with: Entities::Internal::Serverless::VirtualDomain
+ # end
+
+ host = Namespace.find_by_pages_host(params[:host]) || PagesDomain.find_by_domain_case_insensitive(params[:host])
+ no_content! unless host
+
+ virtual_domain = host.pages_virtual_domain
+ no_content! unless virtual_domain
+
+ present virtual_domain, with: Entities::Internal::Pages::VirtualDomain
end
end
end