Commit Graph

134 Commits

Author SHA1 Message Date
GitLab Bot 02cf17adf0 Add latest changes from gitlab-org/gitlab@master 2023-11-23 09:10:00 +00:00
GitLab Bot fe09bd4d74 Add latest changes from gitlab-org/gitlab@master 2023-06-01 15:07:25 +00:00
GitLab Bot 0b54f87a31 Add latest changes from gitlab-org/gitlab@master 2023-05-11 12:12:30 +00:00
GitLab Bot df9890e9a7 Add latest changes from gitlab-org/gitlab@master 2023-01-24 15:07:34 +00:00
GitLab Bot dbfcd56fcb Add latest changes from gitlab-org/gitlab@master 2022-12-14 00:07:31 +00:00
GitLab Bot 3a25b40d55 Add latest changes from gitlab-org/gitlab@master 2022-11-28 15:09:27 +00:00
GitLab Bot a16398e10f Add latest changes from gitlab-org/gitlab@master 2022-07-29 18:08:58 +00:00
GitLab Bot 6078f74ce9 Add latest changes from gitlab-org/gitlab@master 2022-07-20 09:10:09 +00:00
GitLab Bot 0a8d7059a2 Add latest changes from gitlab-org/gitlab@master 2022-06-23 00:09:13 +00:00
GitLab Bot 7a124e225e Add latest changes from gitlab-org/gitlab@master 2022-06-14 12:08:53 +00:00
GitLab Bot 43c14d2d92 Add latest changes from gitlab-org/gitlab@master 2022-05-24 09:09:17 +00:00
GitLab Bot 11df4bf91b Add latest changes from gitlab-org/gitlab@master 2022-05-11 18:07:55 +00:00
GitLab Bot 09409d9dfb Add latest changes from gitlab-org/gitlab@master 2022-05-04 00:09:14 +00:00
GitLab Bot 6a85a7c312 Add latest changes from gitlab-org/gitlab@master 2022-04-20 15:10:23 +00:00
GitLab Bot 541758119c Add latest changes from gitlab-org/gitlab@master 2022-04-19 09:08:55 +00:00
GitLab Bot c4e79e91d7 Add latest changes from gitlab-org/gitlab@master 2022-04-11 00:08:30 +00:00
GitLab Bot 39cb2fdf01 Add latest changes from gitlab-org/gitlab@master 2022-01-20 18:14:18 +00:00
GitLab Bot ac99e71aa5 Add latest changes from gitlab-org/gitlab@master 2022-01-14 21:14:11 +00:00
GitLab Bot 70a50740a2 Add latest changes from gitlab-org/gitlab@master 2021-11-03 15:13:48 +00:00
GitLab Bot 26774b8d98 Add latest changes from gitlab-org/gitlab@master 2021-06-10 00:10:09 +00:00
GitLab Bot de8e5077c3 Add latest changes from gitlab-org/gitlab@master 2021-06-07 12:10:00 +00:00
GitLab Bot 0ae8428c8e Add latest changes from gitlab-org/gitlab@master 2021-05-11 21:10:21 +00:00
GitLab Bot b89bcf56ec Add latest changes from gitlab-org/gitlab@master 2021-04-08 00:09:11 +00:00
GitLab Bot 9c918ae5c6 Add latest changes from gitlab-org/gitlab@master 2021-03-31 21:09:15 +00:00
GitLab Bot 4cb5e5011a Add latest changes from gitlab-org/gitlab@master 2020-03-13 09:09:23 +00:00
GitLab Bot cd52759ee3 Add latest changes from gitlab-org/gitlab@master 2020-03-12 12:09:17 +00:00
GitLab Bot 22e9af3c8b Add latest changes from gitlab-org/gitlab@master 2020-01-27 12:08:35 +00:00
GitLab Bot 2b3bfe8fc5 Add latest changes from gitlab-org/gitlab@master 2020-01-08 00:07:43 +00:00
GitLab Bot 5bd24a54ef Add latest changes from gitlab-org/gitlab@master 2019-12-17 09:07:48 +00:00
GitLab Bot 175b4fa261 Add latest changes from gitlab-org/gitlab@master 2019-12-11 18:08:10 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Paul Slaughter 6e83a31f33 Resolved EE differences in app/views/profiles/keys
**How?**
It creates a base method `can_delete?` on Key
which will always be true in CE and is overridden in EE.

Added changelog entry
2019-05-31 16:13:53 +02:00
Nick Thomas 013f7cd24c
Inherit from ApplicationRecord instead of ActiveRecord::Base 2019-03-28 16:18:23 +00:00
Yorick Peterse 3e63585851
Use a method for the has_many :keys in Project
This moves the `where` in the `has_many :keys` association in Project to
the Key model. This allows EE to override this method, instead of
modifying the source code directly.
2018-11-01 14:20:38 +01:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
gfyoung 50abbd3e53 Enable frozen string in app/models/*.rb
Partially addresses #47424.
2018-07-26 16:55:41 -07:00
Rubén Dávila 75fd832454 Revert "Merge branch 'rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-key' into 'master'"
This reverts commit e607fd7966.
2018-02-15 09:50:19 -05:00
Rubén Dávila 740499bab5 Revert "Merge branch 'rd-40552-gitlab-should-check-if-keys-are-valid-before-saving' into 'master'"
This reverts commit a58f8c32c6, reversing
changes made to cd5d75c362.
2018-02-12 12:39:47 -05:00
Douwe Maan a58f8c32c6 Merge branch 'rd-40552-gitlab-should-check-if-keys-are-valid-before-saving' into 'master'
Sanitize extra blank spaces used when uploading a SSH key

Closes #40552

See merge request gitlab-org/gitlab-ce!16821
2018-02-02 19:18:12 +00:00
Mario de la Ossa eaada9d706 use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
Rubén Dávila 972f564dcd Sanitize extra blank spaces used when uploading a SSH key 2018-02-01 17:00:16 -05:00
Douwe Maan 1e6ca3c41e Consistently schedule Sidekiq jobs 2017-12-05 11:59:39 +01:00
Yorick Peterse 3e561736b2
Cache the number of user SSH keys
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.
2017-11-16 14:59:38 +01:00
Nick Thomas eaa1ce4fbe
Ensure key fingerprints are generated correctly when modified 2017-10-03 18:45:01 +01:00
Yorick Peterse b3566a0104
Stop using Sidekiq for updating Key#last_used_at
This makes things simpler as no scheduling is involved. Further we
remove the need for running a SELECT + UPDATE just to get the key and
update it, whereas we only need an UPDATE when setting last_used_at
directly in a request.

The added service class takes care of updating Key#last_used_at without
using Sidekiq. Further it makes sure we only try to obtain a Redis lease
if we're confident that we actually need to do so, instead of always
obtaining it. We also make sure to _only_ update last_used_at instead of
also updating updated_at.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36663
2017-09-20 14:24:14 +02:00
haseeb cc2daa74d8 created services for keys 2017-09-15 15:35:24 +00:00
Nick Thomas b84ca08e35 Address review comments 2017-08-30 20:50:44 +01:00
Nick Thomas 6847060266 Rework the permissions model for SSH key restrictions
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.

This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.

As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
2017-08-30 20:50:44 +01:00
Nick Thomas b0f982fbdf Add settings for minimum key strength and allowed key type
This is an amalgamation of:

* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
2017-08-30 20:50:44 +01:00
haseeb ae99f05b05 fix #35133 strip new lines from ssh keys 2017-08-03 16:39:10 +00:00