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
da1ad884
Commit
da1ad884
authored
Aug 30, 2021
by
Peter Hegman
Committed by
Vitaly Slobodin
Aug 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add link to public GPG keys on user profile
parent
857300fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
1 deletion
+41
-1
app/views/users/show.html.haml
app/views/users/show.html.haml
+7
-0
config/routes/user.rb
config/routes/user.rb
+1
-1
doc/user/project/repository/gpg_signed_commits/index.md
doc/user/project/repository/gpg_signed_commits/index.md
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+5
-0
spec/features/users/show_spec.rb
spec/features/users/show_spec.rb
+23
-0
No files found.
app/views/users/show.html.haml
View file @
da1ad884
...
@@ -26,6 +26,13 @@
...
@@ -26,6 +26,13 @@
=
link_to
new_abuse_report_path
(
user_id:
@user
.
id
,
ref_url:
request
.
referer
),
class:
link_classes
+
'btn gl-button btn-default btn-icon'
,
=
link_to
new_abuse_report_path
(
user_id:
@user
.
id
,
ref_url:
request
.
referer
),
class:
link_classes
+
'btn gl-button btn-default btn-icon'
,
title:
s_
(
'UserProfile|Report abuse'
),
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
title:
s_
(
'UserProfile|Report abuse'
),
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
sprite_icon
(
'error'
)
=
sprite_icon
(
'error'
)
-
verified_gpg_keys
=
@user
.
gpg_keys
.
select
(
&
:verified?
)
-
if
verified_gpg_keys
.
any?
=
link_to
user_gpg_keys_path
,
class:
link_classes
+
'btn btn-default btn-md gl-button btn-icon has-tooltip'
,
title:
n_
(
'View public GPG key'
,
'View public GPG keys'
,
verified_gpg_keys
.
length
),
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
sprite_icon
(
'key'
,
css_class:
'gl-button-icon gl-icon'
)
-
if
can?
(
current_user
,
:read_user_profile
,
@user
)
-
if
can?
(
current_user
,
:read_user_profile
,
@user
)
=
link_to
user_path
(
@user
,
rss_url_options
),
class:
link_classes
+
'btn gl-button btn-default btn-icon has-tooltip'
,
=
link_to
user_path
(
@user
,
rss_url_options
),
class:
link_classes
+
'btn gl-button btn-default btn-icon has-tooltip'
,
title:
s_
(
'UserProfile|Subscribe'
),
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
title:
s_
(
'UserProfile|Subscribe'
),
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
...
...
config/routes/user.rb
View file @
da1ad884
...
@@ -64,7 +64,7 @@ constraints(::Constraints::UserUrlConstrainer.new) do
...
@@ -64,7 +64,7 @@ constraints(::Constraints::UserUrlConstrainer.new) do
get
':username.keys'
=>
'users#ssh_keys'
,
constraints:
{
username:
Gitlab
::
PathRegex
.
root_namespace_route_regex
}
get
':username.keys'
=>
'users#ssh_keys'
,
constraints:
{
username:
Gitlab
::
PathRegex
.
root_namespace_route_regex
}
# Get all GPG keys of user
# Get all GPG keys of user
get
':username.gpg'
=>
'users#gpg_keys'
,
constraints:
{
username:
Gitlab
::
PathRegex
.
root_namespace_route_regex
}
get
':username.gpg'
=>
'users#gpg_keys'
,
as:
'user_gpg_keys'
,
constraints:
{
username:
Gitlab
::
PathRegex
.
root_namespace_route_regex
}
scope
(
path:
':username'
,
scope
(
path:
':username'
,
as: :user
,
as: :user
,
...
...
doc/user/project/repository/gpg_signed_commits/index.md
View file @
da1ad884
...
@@ -19,6 +19,11 @@ NOTE:
...
@@ -19,6 +19,11 @@ NOTE:
The term GPG is used for all OpenPGP/PGP/GPG related material and
The term GPG is used for all OpenPGP/PGP/GPG related material and
implementations.
implementations.
To view a user's public GPG key, you can:
-
Go to
`https://gitlab.example.com/<username>.gpg`
.
-
Select
**View public GPG keys**
(
**{key}**
) in the top right of the user's profile.
GPG verified tags are not supported yet.
GPG verified tags are not supported yet.
See the
[
further reading
](
#further-reading
)
section for more details on GPG.
See the
[
further reading
](
#further-reading
)
section for more details on GPG.
...
...
locale/gitlab.pot
View file @
da1ad884
...
@@ -36980,6 +36980,11 @@ msgstr ""
...
@@ -36980,6 +36980,11 @@ msgstr ""
msgid "View project labels"
msgid "View project labels"
msgstr ""
msgstr ""
msgid "View public GPG key"
msgid_plural "View public GPG keys"
msgstr[0] ""
msgstr[1] ""
msgid "View replaced file @ "
msgid "View replaced file @ "
msgstr ""
msgstr ""
...
...
spec/features/users/show_spec.rb
View file @
da1ad884
...
@@ -429,4 +429,27 @@ RSpec.describe 'User page' do
...
@@ -429,4 +429,27 @@ RSpec.describe 'User page' do
end
end
end
end
end
end
context
'GPG keys'
do
context
'when user has verified GPG keys'
do
let_it_be
(
:user
)
{
create
(
:user
,
email:
GpgHelpers
::
User1
.
emails
.
first
)
}
let_it_be
(
:gpg_key
)
{
create
(
:gpg_key
,
user:
user
,
key:
GpgHelpers
::
User1
.
public_key
)
}
let_it_be
(
:gpg_key2
)
{
create
(
:gpg_key
,
user:
user
,
key:
GpgHelpers
::
User1
.
public_key2
)
}
it
'shows link to public GPG keys'
do
subject
expect
(
page
).
to
have_link
(
'View public GPG keys'
,
href:
user_gpg_keys_path
(
user
))
end
end
context
'when user does not have verified GPG keys'
do
it
'does not show link to public GPG keys'
do
subject
expect
(
page
).
not_to
have_link
(
'View public GPG key'
,
href:
user_gpg_keys_path
(
user
))
expect
(
page
).
not_to
have_link
(
'View public GPG keys'
,
href:
user_gpg_keys_path
(
user
))
end
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