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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
88ffb080
Commit
88ffb080
authored
Aug 30, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
933b98c6
92855f2c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
11 deletions
+45
-11
app/services/chat_names/authorize_user_service.rb
app/services/chat_names/authorize_user_service.rb
+5
-5
doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md
...domains_ssl_tls_certification/lets_encrypt_integration.md
+3
-0
spec/services/chat_names/authorize_user_service_spec.rb
spec/services/chat_names/authorize_user_service_spec.rb
+17
-4
spec/support/matchers/be_url.rb
spec/support/matchers/be_url.rb
+20
-2
No files found.
app/services/chat_names/authorize_user_service.rb
View file @
88ffb080
...
@@ -24,7 +24,7 @@ module ChatNames
...
@@ -24,7 +24,7 @@ module ChatNames
end
end
def
chat_name_token
def
chat_name_token
Gitlab
::
ChatNameToken
.
new
@chat_name_token
||=
Gitlab
::
ChatNameToken
.
new
end
end
def
chat_name_params
def
chat_name_params
...
...
doc/user/project/pages/custom_domains_ssl_tls_certification/lets_encrypt_integration.md
View file @
88ffb080
...
@@ -21,6 +21,9 @@ such as [#64870](https://gitlab.com/gitlab-org/gitlab-ce/issues/64870).
...
@@ -21,6 +21,9 @@ such as [#64870](https://gitlab.com/gitlab-org/gitlab-ce/issues/64870).
See all the related issues linked from this
[
issue's description
](
https://gitlab.com/gitlab-org/gitlab-ce/issues/28996
)
See all the related issues linked from this
[
issue's description
](
https://gitlab.com/gitlab-org/gitlab-ce/issues/28996
)
for more information.
for more information.
Note:
**Note:**
Using this feature requires
**2 IP addresses**
to be configured to the machine.
## Requirements
## Requirements
Before you can enable automatic provisioning of a SSL certificate for your domain, make sure you have:
Before you can enable automatic provisioning of a SSL certificate for your domain, make sure you have:
...
...
spec/services/chat_names/authorize_user_service_spec.rb
View file @
88ffb080
...
@@ -4,23 +4,36 @@ require 'spec_helper'
...
@@ -4,23 +4,36 @@ require 'spec_helper'
describe
ChatNames
::
AuthorizeUserService
do
describe
ChatNames
::
AuthorizeUserService
do
describe
'#execute'
do
describe
'#execute'
do
let
(
:service
)
{
create
(
:service
)
}
subject
{
described_class
.
new
(
service
,
params
)
}
subject
{
described_class
.
new
(
service
,
params
).
execute
}
let
(
:result
)
{
subject
.
execute
}
let
(
:service
)
{
create
(
:service
)
}
context
'when all parameters are valid'
do
context
'when all parameters are valid'
do
let
(
:params
)
{
{
team_id:
'T0001'
,
team_domain:
'myteam'
,
user_id:
'U0001'
,
user_name:
'user'
}
}
let
(
:params
)
{
{
team_id:
'T0001'
,
team_domain:
'myteam'
,
user_id:
'U0001'
,
user_name:
'user'
}
}
it
'produces a valid HTTP URL'
do
expect
(
result
).
to
be_http_url
end
it
'requests a new token'
do
it
'requests a new token'
do
is_expected
.
to
be_url
expect
(
subject
).
to
receive
(
:request_token
).
once
.
and_call_original
subject
.
execute
end
end
end
end
context
'when there are missing parameters'
do
context
'when there are missing parameters'
do
let
(
:params
)
{
{}
}
let
(
:params
)
{
{}
}
it
'does not produce a URL'
do
expect
(
result
).
to
be_nil
end
it
'does not request a new token'
do
it
'does not request a new token'
do
is_expected
.
to
be_nil
expect
(
subject
).
not_to
receive
(
:request_token
)
subject
.
execute
end
end
end
end
end
end
...
...
spec/support/matchers/be_url.rb
View file @
88ffb080
# frozen_string_literal: true
# frozen_string_literal: true
RSpec
::
Matchers
.
define
:be_url
do
|
_
|
# Assert that this value is a valid URL of at least one type.
#
# By default, this checks that the URL is either a HTTP or HTTPS URI,
# but you can check other URI schemes by passing the type, eg:
#
# ```
# expect(value).to be_url(URI::FTP)
# ```
#
# Pass an empty array of types if you want to match any URI scheme (be
# aware that this might not do what you think it does! `foo` is a valid
# URI, for instance).
RSpec
::
Matchers
.
define
:be_url
do
|
types
=
[
URI
::
HTTP
,
URI
::
HTTPS
]
|
match
do
|
actual
|
match
do
|
actual
|
URI
.
parse
(
actual
)
rescue
false
next
false
unless
actual
.
present?
uri
=
URI
.
parse
(
actual
)
Array
.
wrap
(
types
).
any?
{
|
t
|
uri
.
is_a?
(
t
)
}
rescue
URI
::
InvalidURIError
false
end
end
end
end
# looks better when used like:
# looks better when used like:
# expect(thing).to receive(:method).with(a_valid_url)
# expect(thing).to receive(:method).with(a_valid_url)
RSpec
::
Matchers
.
alias_matcher
:a_valid_url
,
:be_url
RSpec
::
Matchers
.
alias_matcher
:a_valid_url
,
:be_url
RSpec
::
Matchers
.
alias_matcher
:be_http_url
,
:be_url
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