Commit fe9a445f authored by Robert Speicher's avatar Robert Speicher

Merge branch 'evuez/gitlab-ce-add-info-user-api' into 'master'

Expose User#last_sign_in_at and User#confirmed_at for admins

Closes #840

See merge request !3090
parents 24663e80 b0d24ab1
...@@ -12,6 +12,7 @@ v 8.6.0 (unreleased) ...@@ -12,6 +12,7 @@ v 8.6.0 (unreleased)
- Memoize @group in Admin::GroupsController (Yatish Mehta) - Memoize @group in Admin::GroupsController (Yatish Mehta)
- Indicate how much an MR diverged from the target branch (Pierre de La Morinerie) - Indicate how much an MR diverged from the target branch (Pierre de La Morinerie)
- Strip leading and trailing spaces in URL validator (evuez) - Strip leading and trailing spaces in URL validator (evuez)
- Add "last_sign_in_at" and "confirmed_at" to GET /users/* API endpoints for admins (evuez)
- Return empty array instead of 404 when commit has no statuses in commit status API - Return empty array instead of 404 when commit has no statuses in commit status API
- Add support for cross-project label references - Add support for cross-project label references
- Update documentation to reflect Guest role not being enforced on internal projects - Update documentation to reflect Guest role not being enforced on internal projects
......
...@@ -151,6 +151,8 @@ Parameters: ...@@ -151,6 +151,8 @@ Parameters:
"name": "John Smith", "name": "John Smith",
"state": "active", "state": "active",
"created_at": "2012-05-23T08:00:58Z", "created_at": "2012-05-23T08:00:58Z",
"confirmed_at": "2012-05-23T08:00:58Z",
"last_sign_in_at": "2015-03-23T08:00:58Z",
"bio": null, "bio": null,
"skype": "", "skype": "",
"linkedin": "", "linkedin": "",
......
...@@ -23,6 +23,8 @@ module API ...@@ -23,6 +23,8 @@ module API
end end
class UserFull < User class UserFull < User
expose :last_sign_in_at
expose :confirmed_at
expose :email expose :email
expose :theme_id, :color_scheme_id, :projects_limit, :current_sign_in_at expose :theme_id, :color_scheme_id, :projects_limit, :current_sign_in_at
expose :identities, using: Entities::Identity expose :identities, using: Entities::Identity
......
...@@ -47,6 +47,8 @@ describe API::API, api: true do ...@@ -47,6 +47,8 @@ describe API::API, api: true do
expect(json_response.first.keys).to include 'identities' expect(json_response.first.keys).to include 'identities'
expect(json_response.first.keys).to include 'can_create_project' expect(json_response.first.keys).to include 'can_create_project'
expect(json_response.first.keys).to include 'two_factor_enabled' expect(json_response.first.keys).to include 'two_factor_enabled'
expect(json_response.first.keys).to include 'last_sign_in_at'
expect(json_response.first.keys).to include 'confirmed_at'
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment