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
Jérome Perrin
gitlab-ce
Commits
558dd811
Commit
558dd811
authored
Feb 18, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve broadcast message API
parent
833d4ddd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
+7
-4
GITLAB_SHELL_VERSION
GITLAB_SHELL_VERSION
+1
-1
lib/api/helpers.rb
lib/api/helpers.rb
+2
-2
lib/api/internal.rb
lib/api/internal.rb
+2
-0
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+2
-1
No files found.
GITLAB_SHELL_VERSION
View file @
558dd811
2.5.
0
2.5.
1
lib/api/helpers.rb
View file @
558dd811
...
...
@@ -83,7 +83,7 @@ module API
end
def
authenticate_by_gitlab_shell_token!
unauthorized!
unless
secret_token
==
params
[
'secret_token'
]
unauthorized!
unless
secret_token
==
params
[
'secret_token'
]
.
try
(
:chomp
)
end
def
authenticated_as_admin!
...
...
@@ -236,7 +236,7 @@ module API
end
def
secret_token
File
.
read
(
Rails
.
root
.
join
(
'.gitlab_shell_secret'
))
File
.
read
(
Rails
.
root
.
join
(
'.gitlab_shell_secret'
))
.
chomp
end
def
handle_member_errors
(
errors
)
...
...
lib/api/internal.rb
View file @
558dd811
...
...
@@ -73,6 +73,8 @@ module API
get
"/broadcast_message"
do
if
message
=
BroadcastMessage
.
current
present
message
,
with:
Entities
::
BroadcastMessage
else
{}
end
end
end
...
...
spec/requests/api/internal_spec.rb
View file @
558dd811
...
...
@@ -32,7 +32,8 @@ describe API::API, api: true do
it
do
get
api
(
"/internal/broadcast_message"
),
secret_token:
secret_token
expect
(
response
.
status
).
to
eq
(
404
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_empty
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