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
163bb482
Commit
163bb482
authored
Feb 27, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor users and spec
parent
09c4d8e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
ee/lib/ee/gitlab/scim/user.rb
ee/lib/ee/gitlab/scim/user.rb
+3
-2
ee/lib/ee/gitlab/scim/users.rb
ee/lib/ee/gitlab/scim/users.rb
+3
-5
ee/spec/lib/gitlab/scim/user_spec.rb
ee/spec/lib/gitlab/scim/user_spec.rb
+2
-2
No files found.
ee/lib/ee/gitlab/scim/user.rb
View file @
163bb482
...
...
@@ -11,13 +11,14 @@ module EE
identity
.
user
.
name
end
present_collection
true
,
:email
expose
:email_user
,
as: :emails
,
using:
'::EE::Gitlab::Scim::Emails'
private
DEFAULT_SCHEMA
=
'urn:ietf:params:scim:schemas:core:2.0:User'
def
schemas
[
"urn:ietf:params:scim:schemas:core:2.0:User"
]
[
DEFAULT_SCHEMA
]
end
def
active
...
...
ee/lib/ee/gitlab/scim/users.rb
View file @
163bb482
...
...
@@ -9,8 +9,7 @@ module EE
expose
:items_per_page
,
as: :itemsPerPage
expose
:start_index
,
as: :startIndex
present_collection
true
,
:Resources
expose
:resources
,
as: :Resources
,
using:
::
EE
::
Gitlab
::
Scim
::
User
expose
:resources
,
as: :Resources
,
using:
::
EE
::
Gitlab
::
Scim
::
User
#, if: ->(identity, _) { identity.present? }
private
...
...
@@ -23,7 +22,7 @@ module EE
end
def
total_results
1
resources
.
count
end
def
items_per_page
...
...
@@ -35,9 +34,8 @@ module EE
end
# We only support a single resource at the moment
# Please update `total_results` to `resources.count` once this changes
def
resources
[
object
]
object
.
present?
?
[
object
]
:
[
]
end
end
end
...
...
ee/spec/lib/gitlab/scim/user_spec.rb
View file @
163bb482
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
::
EE
::
Gitlab
::
Scim
::
User
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:identity
)
{
create
(
:group_saml_identity
,
user:
user
)
}
let
(
:user
)
{
build
(
:user
)
}
let
(
:identity
)
{
build
(
:group_saml_identity
,
user:
user
)
}
let
(
:entity
)
do
described_class
.
new
(
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