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
a47b32c7
Commit
a47b32c7
authored
Dec 16, 2021
by
Ethan Urie
Committed by
Matthias Käppler
Dec 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove production env check
parent
9f96fd6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
31 deletions
+1
-31
lib/gitlab/spamcheck/client.rb
lib/gitlab/spamcheck/client.rb
+1
-1
spec/lib/gitlab/spamcheck/client_spec.rb
spec/lib/gitlab/spamcheck/client_spec.rb
+0
-30
No files found.
lib/gitlab/spamcheck/client.rb
View file @
a47b32c7
...
@@ -99,7 +99,7 @@ module Gitlab
...
@@ -99,7 +99,7 @@ module Gitlab
end
end
def
client_creds
(
url
)
def
client_creds
(
url
)
if
URI
(
url
).
scheme
==
'tls'
||
Rails
.
env
.
production?
if
URI
(
url
).
scheme
==
'tls'
GRPC
::
Core
::
ChannelCredentials
.
new
(
::
Gitlab
::
X509
::
Certificate
.
ca_certs_bundle
)
GRPC
::
Core
::
ChannelCredentials
.
new
(
::
Gitlab
::
X509
::
Certificate
.
ca_certs_bundle
)
else
else
:this_channel_is_insecure
:this_channel_is_insecure
...
...
spec/lib/gitlab/spamcheck/client_spec.rb
View file @
a47b32c7
...
@@ -56,36 +56,6 @@ RSpec.describe Gitlab::Spamcheck::Client do
...
@@ -56,36 +56,6 @@ RSpec.describe Gitlab::Spamcheck::Client do
end
end
end
end
describe
"Rails environment"
do
let
(
:stub
)
{
double
(
:spamcheck_stub
,
check_for_spam_issue:
response
)
}
context
"production"
do
before
do
allow
(
Rails
.
env
).
to
receive
(
:production?
).
and_return
(
true
)
end
it
'uses secure connection'
do
expect
(
Spamcheck
::
SpamcheckService
::
Stub
).
to
receive
(
:new
).
with
(
endpoint
.
sub
(
%r{^grpc://}
,
''
),
instance_of
(
GRPC
::
Core
::
ChannelCredentials
),
anything
).
and_return
(
stub
)
subject
end
end
context
"not production"
do
before
do
allow
(
Rails
.
env
).
to
receive
(
:production?
).
and_return
(
false
)
end
it
'uses insecure connection'
do
expect
(
Spamcheck
::
SpamcheckService
::
Stub
).
to
receive
(
:new
).
with
(
endpoint
.
sub
(
%r{^grpc://}
,
''
),
:this_channel_is_insecure
,
anything
).
and_return
(
stub
)
subject
end
end
end
describe
'#issue_spam?'
do
describe
'#issue_spam?'
do
before
do
before
do
allow_next_instance_of
(
::
Spamcheck
::
SpamcheckService
::
Stub
)
do
|
instance
|
allow_next_instance_of
(
::
Spamcheck
::
SpamcheckService
::
Stub
)
do
|
instance
|
...
...
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