Commit Graph

684 Commits

Author SHA1 Message Date
Michael Kozono bd578d96b4 Add namespace errors from User#after_update 2017-08-18 10:31:59 -07:00
Michael Kozono 82bafd002d Make username update fail if namespace part fails 2017-08-17 13:18:02 -07:00
http://jneen.net/ f656d4ebc6 expose Referable#non_referable_inspect 2017-08-16 12:02:38 -07:00
Rémy Coutable fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Rémy Coutable be22bf5c73 Merge branch 'rs-remove-username-from-sanitize-attrs' into 'master'
Remove `username` from `User#sanitize_attrs` callback

See merge request !13511
2017-08-14 16:35:14 +00:00
Robert Speicher 260c8da060 Whitelist or fix additional `Gitlab/PublicSend` cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
http://jneen.net/ 8f6205d144 don't send devise notifications to the ghost user 2017-08-11 16:02:10 -07:00
Robert Speicher 64073185ad Remove `username` from `User#sanitize_attrs` callback
This attribute is since validated against `DynamicPathValidator`, which
has strict requirements for the characters allowed, and should no longer
need to be sanitized in a callback before saving.

This has additional benefits in our test suite, where every creation of
a `User` record was calling `Sanitize.clean` on a username value that
was always clean, since we're the ones generating it.
2017-08-11 13:27:38 -04:00
Michael Kozono 255be6c5ca Prevent user from changing username with container registry tags 2017-08-09 16:24:49 +00:00
blackst0ne 67ea6abd07 Use full path of user's avatar in webhooks 2017-08-09 11:42:59 +11:00
Brian Neel 9770c57fab Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04:00
Yorick Peterse ab738645a7
Memoize a user's personal projects count
The method User#projects_limit_left would run "personal_projects.count"
but such a query is not memoized. As a result multiple calls to
User#projects_limit_left would result in multiple COUNT(*) queries being
executed.

To work around this this commit adds User#personal_projects_count which
simply memoizes the result of the COUNT(*) in an instance variable.
2017-08-07 12:38:32 +02:00
Yorick Peterse 4a915c739d
Remove redundant query from User#recent_push
The "events" table has a foreign key on "events.project_id" with a
cascading delete. As such it's impossible for an event to have a
non-existing project ID.
2017-08-07 12:38:32 +02:00
http://jneen.net/ 15643ff91e implement #inspect for all Referables 2017-08-01 13:20:22 -07:00
Alexis Reigel 57ccff8ea4 use db's on_delete instead of has_many :dependent 2017-07-27 15:46:03 +02:00
Alexis Reigel 084cc718f7 use after_commit instead of AfterCommitQueue 2017-07-27 15:43:37 +02:00
Alexis Reigel 9816856d05 perform signature update in sidekiq worker 2017-07-27 15:43:36 +02:00
Alexis Reigel e75ab06430 update invalid gpg signatures when email changes 2017-07-27 15:42:53 +02:00
Alexis Reigel 7e13d96715 don't sync to keychain file 2017-07-27 15:42:53 +02:00
Alexis Reigel 8bd94a7304 remove gpg from keychain when user's email changes 2017-07-27 15:42:04 +02:00
Alexis Reigel 7b4d29f4b5 add profile gpg key page to manage gpg keys 2017-07-27 15:40:41 +02:00
Jarka Kadlecova a9d940bffc Use Ghost user when edited_by, merged_by deleted 2017-07-19 11:35:17 +02:00
Tiago Botelho 574b3efd6b Fixes the user order being overriden in the autocomplete controller 2017-07-14 16:31:45 +01:00
Sean McGivern 1afdbe320e Merge branch 'fixes-for-internal-auth-disabled' into 'master'
Fixes needed when GitLab sign-in is not enabled

See merge request !12491
2017-07-14 08:49:36 +00:00
Robin Bobbitt 672a68d372 Fixes needed when GitLab sign-in is not enabled
When sign-in is disabled:
 - skip password expiration checks
 - prevent password reset requests
 - don’t show Password tab in User Settings
 - don’t allow login with username/password for Git over HTTP requests
 - render 404 on requests to Profiles::PasswordsController
2017-07-13 10:08:27 -04:00
Nathan Neulinger 4f47de62b4 Stop sanitizing user 'name' when inserting into db
Add spec tests for encoding
2017-07-12 07:48:48 -05:00
James Lopez cda7cbde03 refactor created at filter to use model scopes 2017-07-07 18:31:50 +02:00
Yorick Peterse e1a3bf30b6
Rename ActiverecordSerialize cop
This cop has been renamed to ActiveRecordSerialize to match the way
"ActiveRecord" is usually written.
2017-07-06 12:01:36 +02:00
Yorick Peterse 8fbbf41e29
Added Cop to blacklist the use of `dependent:`
This is allowed for existing instances so we don't end up 76 offenses
right away, but for new code one should _only_ use this if they _have_
to remove non database data. Even then it's usually better to do this in
a service class as this gives you more control over how to remove the
data (e.g. in bulk).
2017-07-06 12:01:36 +02:00
Robert Speicher 066a6c8ba8 Merge branch '34078-allow-to-enable-feature-flags-with-more-granularity' into 'master'
Allow the feature flags to be enabled/disabled with more granularity

Closes #34078

See merge request !12357
2017-06-29 16:36:22 +00:00
Tiago Botelho 199425cee6 Inserts exact matches of username, email and name to the top of the user search list 2017-06-29 10:02:41 +01:00
Rémy Coutable 5fa9d6a17d Rename FLippable to FeatureGate and make `flipper_group` and `user` mutually exclusive
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-27 18:59:51 +02:00
Rémy Coutable b4d325c80c Allow the feature flags to be enabled/disabled with more granularity
This allows to enable/disable a feature flag for a given user, or a
given Flipper group (must be declared statically in the `flipper.rb`
initializer beforehand).

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-27 18:59:51 +02:00
Robin Bobbitt 7eb26c7ff7 Provide hint to create a personal access token for Git over HTTP
If internal auth is disabled and user is not an LDAP user, present
the user with an alert to create a personal access token if he does
not have one already.
2017-06-26 14:41:27 -04:00
Sean McGivern bff82b784b Merge branch 'feature/add-new-services' into 'master'
Add additional user and email services

See merge request !12125
2017-06-26 11:42:44 +00:00
James Lopez 4d70c47910 fix spec failures 2017-06-25 08:34:06 +02:00
James Lopez b804db2648 refactor update user service not to do auth checks 2017-06-23 11:41:43 +02:00
James Lopez 785cbb79e2 refactor emails service 2017-06-23 11:41:42 +02:00
James Lopez 0c8e7f49d1 add missing user updates 2017-06-23 11:41:42 +02:00
James Lopez 831b2fccf9 update missing email actions 2017-06-23 11:41:42 +02:00
James Lopez 3bab585bec update to use emails destroy service 2017-06-23 11:41:42 +02:00
Toon Claes b90f1098cf Add User#full_private_access? to check if user has Private access
In CE only the admin has access to all private groups & projects. In EE also an
auditor can have full private access.

To overcome merge conflicts, or accidental incorrect access rights, abstract
this out in `User#full_private_access?`.

`User#admin?` now only should be used for admin-only features. For private
access-related features `User#full_private_access?` should be used.

Backported from gitlab-org/gitlab-ee!2199
2017-06-23 11:15:35 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Tiago Botelho 4449f57ea6 refactors user model validations 2017-06-19 15:48:24 +01:00
Tiago Botelho db33c0fb63 Ensures default user limits when external user is unchecked 2017-06-16 19:26:04 +01:00
Lin Jen-Shin d919f924bf Backport https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1942 2017-06-06 21:42:45 +08:00
Nick Thomas 158581a447 Refactor the DeleteUserWorker 2017-06-05 13:08:06 +01:00
Douwe Maan f123b65233 Merge branch '33215-fix-hard-delete-of-users' into 'master'
Fix hard-deleting users when they have authored issues

Closes #33215

See merge request !11855
2017-06-02 15:10:40 +00:00
Nick Thomas 7db09c63cc Fix hard-deleting users when they have authored issues 2017-06-02 02:06:56 +01:00
Sean McGivern 97d6085fb5 Merge branch 'dm-gravatar-username' into 'master'
Add username parameter to gravatar URL

Closes #24472

See merge request !11741
2017-06-01 17:19:17 +00:00