summaryrefslogtreecommitdiff
path: root/app/services/users
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'forbid-the-usage-of-reload' into 'master'Lin Jen-Shin2019-04-152-3/+3
|\ | | | | | | | | | | | | Forbid the usage of reload Closes #60218 See merge request gitlab-org/gitlab-ce!27125
| * Forbid the use of `#reload` and prefer `#reset`forbid-the-usage-of-reloadKamil Trzciński2019-04-152-3/+3
| | | | | | | | | | | | | | The `#reload` makes to load all objects into memory, and the main purpose of `#reload` is to drop the association cache. The `#reset` seems to solve exactly that case.
* | Fix typo in activity leasefix-typo-activity-leaseCindy Pallares2019-04-111-1/+1
|/
* Add saml provider to user build service9201-create-a-user-via-scim-ceJames Lopez2019-04-051-1/+5
|
* Optimize Redis usage in User::ActivityServiceif-24642-activity_service_optimizationImre Farkas2019-02-141-2/+5
| | | | Avoid checking Redis when User#last_activity_on is already up to date.
* Fix several ActionController::Parameters deprecationsJasper Maes2019-01-111-1/+1
|
* Rename GroupHierarchy into ObjectHierarchyJarka Košanová2018-12-191-1/+1
| | | | | | - we now use the hierarchy class also for epics - also rename supports_nested_groups? into supports_nested_objects? - move it to a concern
* Change deprecated `except!` usagesRobert Speicher2018-12-161-4/+6
| | | | | These can just be `delete` calls, with the caveat that it only takes one argument.
* Use gitlab-default_value_with Rails 5Rémy Coutable2018-11-151-1/+1
| | | | | | | | | | This forks live at https://github.com/gitlabhq/default_value_for/tree/69-fix-action_controller-parameters-handling and fixes an issue where default_value_for wouldn't handle `ActionController::Parameters` correctly with Rails 5. This fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/54093. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix a bug where internal email pattern wasn't respected52940-fix-internal-email-pattern-not-respectedRémy Coutable2018-11-131-4/+4
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* allow users api to set public_emailAlexis Reigel2018-10-011-1/+2
|
* add missing allowed attributesAlexis Reigel2018-10-011-1/+3
|
* remove obsolete allowed attributeAlexis Reigel2018-09-261-1/+0
|
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-113-0/+8
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Allow whitelisting for "external collaborator by default" settingRoger Rüttimann2018-08-301-0/+12
|
* Fix: Project deletion may not log audit events during user deletionValery Sizov2018-08-171-3/+4
|
* Merge branch 'sh-fix-failing-deploy-token-clones' into 'master'Robert Speicher2018-08-021-0/+1
|\ | | | | | | | | | | | | Fix failing 500 errors when deploy tokens are used to clone Closes gitlab-ee#7080 See merge request gitlab-org/gitlab-ce!20993
| * Fix failing 500 errors when deploy tokens are used to cloneStan Hu2018-08-021-0/+1
| | | | | | | | | | | | | | A DeployToken responds to `:username`, but it returns the username for the token, not a User object. Don't attempt to log user activity in this case. Closes gitlab-org/gitlab-ee#7080
* | Show the status of a user in interactionsBob Van Landuyt2018-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The status is shown for - The author of a commit when viewing a commit - Notes on a commit (regular/diff) - The user that triggered a pipeline when viewing a pipeline - The author of a merge request when viewing a merge request - The author of notes on a merge request (regular/diff) - The author of an issue when viewing an issue - The author of notes on an issue - The author of a snippet when viewing a snippet - The author of notes on a snippet - A user's profile page - The list of members of a group/user
* | Allow users to set a statusBob Van Landuyt2018-07-302-2/+48
|/ | | | | This can be done trough the API for the current user, or on the profile page.
* Add an option to have a private profile on GitLabJX Terry2018-07-241-1/+2
|
* Merge branch 'frozen-string-enable-apps-services-inner-even-more' into 'master'Rémy Coutable2018-07-199-0/+18
|\ | | | | | | | | Enable more frozen string in app/services/**/*.rb See merge request gitlab-org/gitlab-ce!20702
| * Enable more frozen string in app/services/**/*.rbgfyoung2018-07-189-0/+18
| | | | | | | | Partially addresses #47424.
* | Delete UserActivities and related workers43312-remove_user_activity_workersImre Farkas2018-07-181-4/+16
|/
* Cleanly handle plural name for ghost user migrationOlivier Gonzalez2018-05-071-2/+2
|
* Allow a user to accept/decline termsBob Van Landuyt2018-05-041-0/+24
| | | | | When a user accepts, we store this in the agreements to keep track of which terms they accepted. We also update the flag on the user.
* Backport relevant changes from EE ↵backport-ee-3892-to-ceTiago Botelho2018-03-071-0/+2
| | | | https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4827 to CE
* use Gitlab::UserSettings directly as a singleton instead of ↵Mario de la Ossa2018-02-021-4/+2
| | | | including/extending it
* Remove soft removals related codeYorick Peterse2018-01-081-1/+1
| | | | | | | | | | | | | | This removes all usage of soft removals except for the "pending delete" system implemented for projects. This in turn simplifies all the query plans of the models that used soft removals. Since we don't really use soft removals for anything useful there's no point in keeping it around. This _does_ mean that hard removals of issues (which only admins can do if I'm not mistaken) can influence the "iid" values, but that code is broken to begin with. More on this (and how to fix it) can be found in https://gitlab.com/gitlab-org/gitlab-ce/issues/31114. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
* Fix user membership destroy relationFrancisco Javier López2018-01-021-0/+5
|
* Allow password authentication to be disabled entirelyMarkus Koller2017-11-231-1/+1
|
* Cache the number of user SSH keyscache-user-keys-countYorick Peterse2017-11-161-0/+27
| | | | | | | | | By caching the number of personal SSH keys we reduce the number of queries necessary on pages such as ProjectsController#show (which can end up querying this data multiple times). The cache is refreshed/flushed whenever an SSH key is added, removed, or when a user is removed.
* Refactor issuable destroy actionJarka Kadlecova2017-11-061-7/+11
|
* Only cache the event for the fork-source when it existsbvl-fix-push-event-service-for-forksBob Van Landuyt2017-10-221-2/+2
| | | | | It is possible for a fork not to have a source anymore, in this case we don't need to keep track of the push event.
* Create idea of read-only databasetc-geo-read-only-ideaToon Claes2017-10-061-1/+1
| | | | | | | | | | | | In GitLab EE, a GitLab instance can be read-only (e.g. when it's a Geo secondary node). But in GitLab CE it also might be useful to have the "read-only" idea around. So port it back to GitLab CE. Also having the principle of read-only in GitLab CE would hopefully lead to less errors introduced, doing write operations when there aren't allowed for read-only calls. Closes gitlab-org/gitlab-ce#37534.
* fix update serviceJames Lopez2017-09-281-1/+1
|
* refactor users update serviceJames Lopez2017-09-281-2/+2
|
* fix users update serviceJames Lopez2017-09-281-3/+5
|
* update initializersJames Lopez2017-09-281-1/+2
|
* refactor services to match EE signatureJames Lopez2017-09-281-5/+7
|
* Rework how recent push events are retrieveduser-recent-pushYorick Peterse2017-09-081-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever you push to a branch GitLab will show a button to create a merge request (should one not exist already). The underlying code to display this data was quite inefficient. For example, it involved multiple slow queries just to figure out what the most recent push event was. This commit changes the way this data is retrieved so it's much faster. This is achieved by caching the ID of the last push event on every push, which is then retrieved when loading certain pages. Database queries are only executed if necessary and the cached data is removed automatically once a merge request has been created, or 2 hours after being stored. A trade-off of this approach is that we _only_ track the last event. Previously if you were to push to branch A and B then create a merge request for branch B we'd still show the widget for branch A. As of this commit this is no longer the case, instead we will only show the widget for the branch you pushed to most recently. Once a merge request exists the widget is no longer displayed. Alternative solutions are either too complex and/or too slow, hence the decision was made to settle for this trade-off. Performance Impact ------------------ In the best case scenario (= a user didn't push anything for more than 2 hours) we perform a single Redis GET per page. Should there be cached data we will run a single (and lightweight) SQL query to get the event data from the database. If a merge request already exists we will run an additional DEL to remove the cache key. The difference in response timings can vary a bit per project. On GitLab.com the 99th percentile of time spent in User#recent_push hovers between 100 milliseconds and 1 second, while the mean hovers around 50 milliseconds. With the changes in this MR the expected time spent in User#recent_push is expected to be reduced down to just a few milliseconds. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/35990
* Profile updates from providersAlexander Keramidas2017-09-061-0/+4
|
* `current_application_settings` belongs on `Gitlab::CurrentSettings`Sean McGivern2017-08-311-0/+2
| | | | | | | | | | | | | | | | The initializers including this were doing so at the top level, so every object loaded after them had a `current_application_settings` method. However, if someone had rack-attack enabled (which was loaded before these initializers), it would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't have that method. To fix this: 1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need `Object.new.current_application_settings` to work. 2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it like that in several places. 3. Change the initializers to use that new form.
* Fire system hooks when a user is created via LDAP or OAuthsh-system-hooks-ldap-usersStan Hu2017-08-252-5/+9
| | | | Closes #37073
* Make sure repository's removal work for legacy and hashed storages28283-uuid-storageGabriel Mazetto2017-08-221-2/+4
|
* Use Ghost user when edited_by, merged_by deleted34930-fix-edited-byJarka Kadlecova2017-07-191-0/+2
|
* Fix current feature related specsTiago Botelho2017-06-281-1/+1
|
* update code based on feedbackJames Lopez2017-06-233-5/+2
|
* refactor update user service not to do auth checksJames Lopez2017-06-231-12/+5
|
* fix specsJames Lopez2017-06-231-1/+1
|