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
c1753f5c
Commit
c1753f5c
authored
May 29, 2019
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended LDAP key model
Keys, coming from LDAP should not be removable from GitLab's interface
parent
89364ec6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
ee/app/models/ldap_key.rb
ee/app/models/ldap_key.rb
+3
-0
ee/spec/features/admin/admin_users_spec.rb
ee/spec/features/admin/admin_users_spec.rb
+31
-0
No files found.
ee/app/models/ldap_key.rb
View file @
c1753f5c
# frozen_string_literal: true
class
LDAPKey
<
Key
def
can_delete?
false
end
end
ee/spec/features/admin/admin_users_spec.rb
View file @
c1753f5c
...
...
@@ -83,4 +83,35 @@ describe "Admin::Users" do
end
end
end
describe
'show user keys for SSH and LDAP'
do
let!
(
:key1
)
do
create
(
:ldap_key
,
user:
user
,
title:
"LDAP Key1"
)
end
let!
(
:key2
)
do
create
(
:key
,
user:
user
,
title:
"ssh-rsa Key2"
,
key:
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key2"
)
end
it
do
visit
admin_users_path
click_link
user
.
name
click_link
'SSH keys'
# Check that the regular Key shows the delete icon and the LDAPKey does not
# SSH key should be the first in the list
within
(
'ul.content-list li.key-list-item:nth-of-type(1)'
)
do
expect
(
page
).
to
have_content
(
key2
.
title
)
expect
(
page
).
to
have_css
(
'a[data-method=delete]'
,
text:
'Remove'
)
end
# Next, LDAP key
within
(
'ul.content-list li.key-list-item:nth-of-type(2)'
)
do
expect
(
page
).
to
have_content
(
key1
.
title
)
expect
(
page
).
not_to
have_css
(
'a[data-method=delete]'
)
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