diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2019-06-21 15:06:12 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-06-21 15:06:12 +0300 |
commit | 6119d5ad7518f547af216d3bdc3d1fcffcfc9c71 (patch) | |
tree | cc1a1e74efb5e44bd5c5d152da85b7fed4ff2107 /spec/requests | |
parent | 176164d37423ffb39d293341799aff757f050d7c (diff) |
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 'spec/requests')
-rw-r--r-- | spec/requests/api/pages_domains_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/requests/api/pages_domains_spec.rb b/spec/requests/api/pages_domains_spec.rb index 3eb68a6abb6..449032b95b7 100644 --- a/spec/requests/api/pages_domains_spec.rb +++ b/spec/requests/api/pages_domains_spec.rb @@ -359,6 +359,14 @@ describe API::PagesDomains do expect(pages_domain_secure.certificate).to eq(params_secure_nokey[:certificate]) end + it 'updates certificate source to user_provided if is changed' do + pages_domain.update!(certificate_source: 'gitlab_provided') + + expect do + put api(route_domain, user), params: params_secure + end.to change { pages_domain.reload.certificate_source }.from('gitlab_provided').to('user_provided') + end + it 'fails to update pages domain adding certificate without key' do put api(route_domain, user), params: params_secure_nokey |