diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-06-21 12:06:12 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-21 12:06:12 +0000 |
commit | 6119d5ad7518f547af216d3bdc3d1fcffcfc9c71 (patch) | |
tree | cc1a1e74efb5e44bd5c5d152da85b7fed4ff2107 /app/controllers/projects/pages_domains_controller.rb | |
parent | 176164d37423ffb39d293341799aff757f050d7c (diff) | |
download | gitlab-ce-6119d5ad7518f547af216d3bdc3d1fcffcfc9c71.tar.gz |
Don't show private keys for letsencrypt certs
Adds enum certificate_source to pages_domains table
with default manually_uploaded
Mark certificates as 'gitlab_provided'
if the were obtained through Let's Encrypt
Mark certificates as 'user_provided' if they were uploaded through
controller or api
Only show private key in domain edit form if it is 'user_provided'
Only show LetsEncrypt option if is enabled by application settings
(and feature flag)
Refactor and fix some specs to match new logic
Don't show Let's Encrypt certificates as well
Diffstat (limited to 'app/controllers/projects/pages_domains_controller.rb')
-rw-r--r-- | app/controllers/projects/pages_domains_controller.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/projects/pages_domains_controller.rb b/app/controllers/projects/pages_domains_controller.rb index 89f21d8dadb..c287e440db0 100644 --- a/app/controllers/projects/pages_domains_controller.rb +++ b/app/controllers/projects/pages_domains_controller.rb @@ -65,16 +65,14 @@ class Projects::PagesDomainsController < Projects::ApplicationController private def create_params - params.require(:pages_domain).permit(:key, :certificate, :domain, :auto_ssl_enabled) + params.require(:pages_domain).permit(:user_provided_key, :user_provided_certificate, :domain, :auto_ssl_enabled) end def update_params - params.require(:pages_domain).permit(:key, :certificate, :auto_ssl_enabled) + params.require(:pages_domain).permit(:user_provided_key, :user_provided_certificate, :auto_ssl_enabled) end - # rubocop: disable CodeReuse/ActiveRecord def domain - @domain ||= @project.pages_domains.find_by!(domain: params[:id].to_s) + @domain ||= @project.pages_domains.find_by_domain!(params[:id].to_s) end - # rubocop: enable CodeReuse/ActiveRecord end |