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
73df7adb
Commit
73df7adb
authored
Feb 26, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update saml identity finder
parent
92dc05c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
ee/app/finders/group_saml_identity_finder.rb
ee/app/finders/group_saml_identity_finder.rb
+4
-0
ee/spec/finders/group_saml_identity_finder_spec.rb
ee/spec/finders/group_saml_identity_finder_spec.rb
+16
-0
No files found.
ee/app/finders/group_saml_identity_finder.rb
View file @
73df7adb
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
class
GroupSamlIdentityFinder
class
GroupSamlIdentityFinder
attr_reader
:user
attr_reader
:user
def
self
.
find_by_group_and_uid
(
group
:,
uid
:)
group
&
.
saml_provider
&
.
identities
&
.
find_by_extern_uid
(
uid
)
end
def
initialize
(
user
:)
def
initialize
(
user
:)
@user
=
user
@user
=
user
end
end
...
...
ee/spec/finders/group_saml_identity_finder_spec.rb
View file @
73df7adb
...
@@ -11,6 +11,22 @@ describe GroupSamlIdentityFinder do
...
@@ -11,6 +11,22 @@ describe GroupSamlIdentityFinder do
subject
{
described_class
.
new
(
user:
user
)
}
subject
{
described_class
.
new
(
user:
user
)
}
describe
".find_by_group_and_uid"
do
it
"finds identity matching user and group"
do
expect
(
described_class
.
find_by_group_and_uid
(
group:
group
,
uid:
identity
.
extern_uid
)).
to
eq
(
identity
)
end
it
"returns nil when no saml_provider exists"
do
group
.
saml_provider
.
destroy!
expect
(
described_class
.
find_by_group_and_uid
(
group:
group
,
uid:
identity
.
extern_uid
)).
to
eq
(
nil
)
end
it
"returns nil when group is nil"
do
expect
(
described_class
.
find_by_group_and_uid
(
group:
nil
,
uid:
identity
.
extern_uid
)).
to
eq
(
nil
)
end
end
describe
"#find_linked"
do
describe
"#find_linked"
do
it
"finds identity matching user and group"
do
it
"finds identity matching user and group"
do
expect
(
subject
.
find_linked
(
group:
group
)).
to
eq
(
identity
)
expect
(
subject
.
find_linked
(
group:
group
)).
to
eq
(
identity
)
...
...
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