summaryrefslogtreecommitdiff
path: root/app/models/key.rb
Commit message (Collapse)AuthorAgeFilesLines
* Cache the number of user SSH keyscache-user-keys-countYorick Peterse2017-11-161-0/+8
| | | | | | | | | 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.
* Ensure key fingerprints are generated correctly when modifiedNick Thomas2017-10-031-0/+1
|
* Stop using Sidekiq for updating Key#last_used_atremove-use-key-workerYorick Peterse2017-09-201-6/+1
| | | | | | | | | | | | | | | 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
* created services for keyshaseeb2017-09-151-5/+0
|
* Address review commentsNick Thomas2017-08-301-1/+0
|
* Rework the permissions model for SSH key restrictionsNick Thomas2017-08-301-25/+12
| | | | | | | | | | | | | | | `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.
* Add settings for minimum key strength and allowed key typeNick Thomas2017-08-301-1/+44
| | | | | | | | This is an amalgamation of: * Cory Hinshaw: Initial implementation !5552 * Rémy Coutable: Updates !9350 * Nick Thomas: Resolve conflicts and add ED25519 support !13712
* fix #35133 strip new lines from ssh keyshaseeb2017-08-031-2/+1
|
* Don’t schedule workers from inside transactionsDouwe Maan2017-06-021-5/+4
|
* Enable the Style/TrailingCommaInArguments copRémy Coutable2017-05-101-1/+1
| | | | | | Use the EnforcedStyleForMultiline: no_comma option. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Record used SSH keys only once per dayrecord-used-ssh-keys-once-per-dayAdam Niedzielski2017-01-201-1/+6
| | | | | Use Gitlab::ExclusiveLease to make sure that we enqueue Sidekiq job at most once per day for given key.
* Record and show last used date of SSH KeysVincent Wong2017-01-091-0/+4
| | | | | | | | Addresses: Issue #13810 1. Adds a last_used_at attribute to the Key table/model 2. Update a key's last_used_at whenever it gets used 3. Display how long ago an ssh key was last used
* Merge CSSFilipa Lacerda2016-12-121-4/+12
|\
| * Use :maximum instead of :within for length validators with a 0..N range25209-improve-length-validatorsRémy Coutable2016-12-061-4/+12
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Don't notify user for deploy keys, feedback:Lin Jen-Shin2016-11-181-4/+4
|/ | | | https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7383#note_18517263
* Use setter for key instead AR callbackSemyon Pupkov2016-11-161-3/+4
| | | | ref: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6763
* Add simple identifier to public SSH keysKeith Pope2016-08-021-2/+3
|
* Remove Duplicated keys add UNIQUE index to fingerprint18697-uniqueness-key-validationPaco Guzman2016-06-201-1/+1
|
* Add leading comment space copissue_15557Felipe Artur2016-05-311-1/+1
|
* Remove the annotate gem and delete old annotationsJeroen van Baarsen2016-05-091-15/+0
| | | | | | | | | In 8278b763d96ef10c6494409b18b7eb541463af29 the default behaviour of annotation has changes, which was causing a lot of noise in diffs. We decided in #17382 that it is better to get rid of the whole annotate gem, and instead let people look at schema.rb for the columns in a table. Fixes: #17382
* Annotate the modelsZeger-Jan van de Weg2016-05-061-3/+3
|
* Ensure "new SSH key" email do not ends up as dead Sidekiq jobsfix/ensure-no-new_ssh_key_email-dead-jobsRémy Coutable2016-03-151-1/+2
| | | | | | | | Related to #2235. This is done by: 1. Delaying the notification sending after the SSH key is commited in DB 2. Gracefully exit the mailer method if the record cannot be found
* Only publish ssh key-type and keyZeger-Jan van de Weg2015-08-041-0/+5
|
* Add error message for SSH key linebreaksNikita Verkhovin2015-07-121-0/+1
|
* Re-annotate modelsStan Hu2015-05-031-0/+1
|
* Refactor key fingerprint generation.Douwe Maan2015-04-141-40/+4
|
* The new fingerprint format wis incompatible with the previous regex.Sašo Stanovnik2015-03-241-4/+11
|
* Use 2 spaces for indentation, not 4.Sašo Stanovnik2015-03-241-1/+1
|
* Fixed generating SSH key fingerprints in OpenSSH 6.8.Sašo Stanovnik2015-03-241-1/+18
|
* Explicitly define ordering in models using default_scopeDmitriy Zaporozhets2015-02-051-0/+1
|
* Fix various typosSteven Burgart2015-01-181-2/+2
| | | | | | | | | | | | | | | signe-in -> signed-in go_to_gihub_for_permissions -> go_to_github_for_permissions descendand -> descendant behavour -> behaviour recepient_email -> recipient_email generate_fingerpint -> generate_fingerprint dependes -> depends Cant't -> Can't wisit -> visit notifcation -> notification sufficent_scope -> sufficient_scope? levet -> level
* Simplify SSH fingerprint regexp extractionCiro Santilli2014-12-281-1/+1
| | | | [\d\h] is the same as \h
* Add system hook for ssh key changesLukas Erlacher2014-09-031-0/+10
| | | | | | Add system hook for ssh key create and destroy Update and fix documentation Update tests
* Key strong paramsDmitriy Zaporozhets2014-06-261-2/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Re-annotate modelsDmitriy Zaporozhets2014-04-091-2/+2
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Remove KeysObserverDmitriy Zaporozhets2014-04-021-0/+24
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Adapt use of Gitlab::Popen to new styleJacob Vosmaer2014-02-251-1/+1
|
* ReannotateDmitriy Zaporozhets2013-08-211-8/+8
|
* Validate fingerprint uniquenessJacob Vosmaer2013-07-171-14/+5
|
* Use Tempfile.open for automatic cleanupJacob Vosmaer2013-07-171-6/+1
|
* Merge branch 'master' into 6-0-devDmitriy Zaporozhets2013-07-121-1/+1
|\
| * Allow ecdsa SSH keysAkiva Levy2013-07-101-1/+1
| | | | | | Update app/models/key.rb to permit SSH keys of type ecdsa rather than forcing dsa and rsa algorithms.
* | store and display public key fingerprintDmitriy Zaporozhets2013-06-241-9/+31
| |
* | AnnotatedDmitriy Zaporozhets2013-06-191-3/+3
|/
* More strict validation for SSH Key contentDmitriy Zaporozhets2013-05-131-1/+1
|
* Feature: Deploy keys between projectsDmitriy Zaporozhets2013-05-061-4/+0
|
* Create DeployKey & DeployKeysProject models. Bulding many to many relation ↵Dmitriy Zaporozhets2013-05-061-8/+3
| | | | between deploy keys and projects
* Update model methodsAndrey Kumanyaev2013-04-031-2/+2
|
* remove unused code related to gitoliteDmitriy Zaporozhets2013-02-261-9/+0
|
* Merge pull request #2996 from raphendyr/ssh_fingerprint_fixDmitriy Zaporozhets2013-02-181-1/+1
|\ | | | | Ssh fingerprint fix