Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
686795ee
Commit
686795ee
authored
Mar 26, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow pages domain verification to run on invalid domains
parent
f6eeb135
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
app/services/verify_pages_domain_service.rb
app/services/verify_pages_domain_service.rb
+7
-3
changelogs/unreleased/43794-fix-domain-verification-validation-errors.yml
...eased/43794-fix-domain-verification-validation-errors.yml
+5
-0
spec/services/verify_pages_domain_service_spec.rb
spec/services/verify_pages_domain_service_spec.rb
+19
-0
No files found.
app/services/verify_pages_domain_service.rb
View file @
686795ee
...
...
@@ -34,7 +34,8 @@ class VerifyPagesDomainService < BaseService
# Prevent any pre-existing grace period from being truncated
reverify
=
[
domain
.
enabled_until
,
VERIFICATION_PERIOD
.
from_now
].
compact
.
max
domain
.
update!
(
verified_at:
Time
.
now
,
enabled_until:
reverify
)
domain
.
assign_attributes
(
verified_at:
Time
.
now
,
enabled_until:
reverify
)
domain
.
save!
(
validate:
false
)
if
was_disabled
notify
(
:enabled
)
...
...
@@ -47,7 +48,9 @@ class VerifyPagesDomainService < BaseService
def
unverify_domain!
if
domain
.
verified?
domain
.
update!
(
verified_at:
nil
)
domain
.
assign_attributes
(
verified_at:
nil
)
domain
.
save!
(
validate:
false
)
notify
(
:verification_failed
)
end
...
...
@@ -55,7 +58,8 @@ class VerifyPagesDomainService < BaseService
end
def
disable_domain!
domain
.
update!
(
verified_at:
nil
,
enabled_until:
nil
)
domain
.
assign_attributes
(
verified_at:
nil
,
enabled_until:
nil
)
domain
.
save!
(
validate:
false
)
notify
(
:disabled
)
...
...
changelogs/unreleased/43794-fix-domain-verification-validation-errors.yml
0 → 100644
View file @
686795ee
---
title
:
Avoid validation errors when running the Pages domain verification service
merge_request
:
17992
author
:
type
:
fixed
spec/services/verify_pages_domain_service_spec.rb
View file @
686795ee
...
...
@@ -93,6 +93,25 @@ describe VerifyPagesDomainService do
expect
(
domain
).
not_to
be_enabled
end
end
context
'invalid domain'
do
let
(
:domain
)
{
build
(
:pages_domain
,
:expired
,
:with_missing_chain
)
}
before
do
domain
.
save
(
validate:
false
)
end
it
'can be disabled'
do
error_status
[
:message
]
+=
'. It is now disabled.'
stub_resolver
expect
(
service
.
execute
).
to
eq
(
error_status
)
expect
(
domain
).
not_to
be_verified
expect
(
domain
).
not_to
be_enabled
end
end
end
context
'timeout behaviour'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment