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
9172d320
Commit
9172d320
authored
Dec 04, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor git access spec, update docs
parent
903aab5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
15 deletions
+6
-15
doc/gitlab-geo/using_a_geo_server.md
doc/gitlab-geo/using_a_geo_server.md
+2
-0
ee/lib/ee/gitlab/git_access.rb
ee/lib/ee/gitlab/git_access.rb
+1
-12
spec/ee/spec/lib/ee/gitlab/git_access_spec.rb
spec/ee/spec/lib/ee/gitlab/git_access_spec.rb
+3
-3
No files found.
doc/gitlab-geo/using_a_geo_server.md
View file @
9172d320
[
//
]:
#
(Please update EE::GitLab::GeoGitAccess::GEO_SERVER_DOCS_URL if this file is moved)
# Using a Geo Server
# Using a Geo Server
After you set up the
[
database replication and configure the GitLab Geo nodes
][
req
]
,
After you set up the
[
database replication and configure the GitLab Geo nodes
][
req
]
,
...
...
ee/lib/ee/gitlab/git_access.rb
View file @
9172d320
module
EE
module
EE
module
Gitlab
module
Gitlab
module
GitAccess
module
GitAccess
GEO_SERVER_DOCS_URL
=
'https://docs.gitlab.com/ee/gitlab-geo/using_a_geo_server.html'
.
freeze
prepend
GeoGitAccess
def
check
(
cmd
,
changes
)
def
check
(
cmd
,
changes
)
raise
NotImplementedError
.
new
unless
defined?
(
super
)
raise
NotImplementedError
.
new
unless
defined?
(
super
)
...
@@ -65,17 +65,6 @@ module EE
...
@@ -65,17 +65,6 @@ module EE
def
geo?
def
geo?
geo_node_key?
||
actor
==
:geo
geo_node_key?
||
actor
==
:geo
end
end
def
push_to_read_only_message
message
=
super
if
::
Gitlab
::
Geo
.
primary_node
primary_url
=
ActionController
::
Base
.
helpers
.
link_to
(
'primary node'
,
::
Gitlab
::
Geo
.
primary_node
.
url
)
message
+=
" Please use the Primary node URL:
#{
primary_url
.
html_safe
}
. Documentation:
#{
GEO_SERVER_DOCS_URL
}
"
end
message
end
end
end
end
end
end
end
spec/ee/spec/lib/ee/gitlab/git_access_spec.rb
View file @
9172d320
...
@@ -10,7 +10,7 @@ describe Gitlab::GitAccess do
...
@@ -10,7 +10,7 @@ describe Gitlab::GitAccess do
let
(
:redirected_path
)
{
nil
}
let
(
:redirected_path
)
{
nil
}
let
(
:access
)
{
described_class
.
new
(
actor
,
project
,
protocol
,
authentication_abilities:
authentication_abilities
,
redirected_path:
redirected_path
)
}
let
(
:access
)
{
described_class
.
new
(
actor
,
project
,
protocol
,
authentication_abilities:
authentication_abilities
,
redirected_path:
redirected_path
)
}
let
(
:push_access_check
)
{
access
.
check
(
'git-receive-pack'
,
'_any'
)
}
subject
{
access
.
check
(
'git-receive-pack'
,
'_any'
)
}
context
"when in a read-only GitLab instance"
do
context
"when in a read-only GitLab instance"
do
before
do
before
do
...
@@ -21,7 +21,7 @@ describe Gitlab::GitAccess do
...
@@ -21,7 +21,7 @@ describe Gitlab::GitAccess do
it
'denies push access'
do
it
'denies push access'
do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
expect
{
push_access_check
}.
to
raise_unauthorized
(
"You can't push code to a read-only GitLab instance."
)
expect
{
subject
}.
to
raise_unauthorized
(
"You can't push code to a read-only GitLab instance."
)
end
end
it
'denies push access with primary present'
do
it
'denies push access with primary present'
do
...
@@ -33,7 +33,7 @@ describe Gitlab::GitAccess do
...
@@ -33,7 +33,7 @@ describe Gitlab::GitAccess do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
expect
{
push_access_check
}.
to
raise_unauthorized
(
error_message
)
expect
{
subject
}.
to
raise_unauthorized
(
error_message
)
end
end
end
end
...
...
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