summaryrefslogtreecommitdiff
path: root/spec/models/key_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-121-8/+41
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-271-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-191-0/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-171-0/+26
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-111-0/+3
|
* Add # frozen_string_literal to spec/modelsThong Kuah2019-04-011-0/+2
| | | | Adds `# frozen_string_literal: true` to spec/models ruby files
* Validate SSH keys through the sshkey gemrd-40552-gitlab-should-check-if-keys-are-valid-before-savingRubén Dávila2018-02-161-18/+3
|
* Revert "Merge branch ↵Rubén Dávila2018-02-151-7/+44
| | | | | | 'rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-key' into 'master'" This reverts commit e607fd796657afd214b8f25201919d3e33b3f35f.
* Revert "Merge branch ↵rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-keyRubén Dávila2018-02-121-44/+7
| | | | | | | 'rd-40552-gitlab-should-check-if-keys-are-valid-before-saving' into 'master'" This reverts commit a58f8c32c62bcf5824d1fe1d0de53e9bda974d65, reversing changes made to cd5d75c362cdf06efb8174eddfbd0f4b65687dec.
* Merge branch 'rd-40552-gitlab-should-check-if-keys-are-valid-before-saving' ↵Douwe Maan2018-02-021-7/+44
|\ | | | | | | | | | | | | | | | | into 'master' Sanitize extra blank spaces used when uploading a SSH key Closes #40552 See merge request gitlab-org/gitlab-ce!16821
| * Sanitize extra blank spaces used when uploading a SSH keyRubén Dávila2018-02-011-7/+44
| |
* | use Gitlab::UserSettings directly as a singleton instead of ↵Mario de la Ossa2018-02-021-7/+0
|/ | | | including/extending it
* Cache the number of user SSH keyscache-user-keys-countYorick Peterse2017-11-161-0/+23
| | | | | | | | | 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/+10
|
* Stop using Sidekiq for updating Key#last_used_atremove-use-key-workerYorick Peterse2017-09-201-22/+9
| | | | | | | | | | | | | | | 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-12/+0
|
* Rework the permissions model for SSH key restrictionsNick Thomas2017-08-301-48/+18
| | | | | | | | | | | | | | | `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-2/+83
| | | | | | | | This is an amalgamation of: * Cory Hinshaw: Initial implementation !5552 * Rémy Coutable: Updates !9350 * Nick Thomas: Resolve conflicts and add ED25519 support !13712
* Backport changes in ↵Nick Thomas2017-08-071-10/+0
| | | | https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE
* Merge branch 'use-rspec-support-helper' into 'master'Rémy Coutable2017-08-031-3/+1
|\ | | | | | | | | Don't include EmailHelpers manually, pick with rspec See merge request !13257
| * Don't include EmailHelpers manually, pick with rspecuse-rspec-support-helperLin Jen-Shin2017-08-031-3/+1
| | | | | | | | | | | | | | | | | | `:mailer` is needed to pick it easily, while `type: :mailer` is needed for picking it automatically for tests located in spec/mailers/*_spec.rb It's a bit complicated in spec/services/notification_service_spec.rb but we'll leave it alone for now.
* | fix #35133 strip new lines from ssh keyshaseeb2017-08-031-6/+8
|/
* Remove superfluous lib: true, type: redis, service: true, models: true, ↵Rémy Coutable2017-07-271-1/+1
| | | | | | services: true, no_db: true, api: true Signed-off-by: Rémy Coutable <remy@rymai.me>
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-4/+4
|
* Lint our factories creation in addition to their build33139-lint-our-factoriesRémy Coutable2017-06-021-4/+6
| | | | 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-4/+23
| | | | | 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/+9
| | | | | | | | 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-2/+6
|\
| * Use :maximum instead of :within for length validators with a 0..N range25209-improve-length-validatorsRémy Coutable2016-12-061-2/+6
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Now we need to include EmailHelpers for each testLin Jen-Shin2016-12-061-0/+2
| |
* | Merge remote-tracking branch 'upstream/master' into ↵Lin Jen-Shin2016-11-221-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature/1376-allow-write-access-deploy-keys * upstream/master: (497 commits) Use single quote for strings Ue svg from SVGs object Dont trigger CI builds [ci skip] Revert "Test only migrations" Add custom copy for each empty stage Fetch only one revision Highlight nav item on hover Test only migrations Fix migration paths tests Scroll CA stage panel on mobile Fix CSS declaration administer to administrator Move SVGs to JS objects for easy reuse Improve deploy command message No enough data to Not enough data Keep the cookie name as before Fix variable usage Evalute time_ago method instead of printing it Removed button styling from restricted visibility levels and added checkboxes with icons Do not show overview message if there’s already CA data ...
| * Use `Gitlab.config.gitlab.host` over `'localhost'`fix-tests-for-different-hostLin Jen-Shin2016-11-181-1/+1
| | | | | | | | | | | | | | | | This would fix long standing failures running tests on my development machine, which set `Gitlab.config.gitlab.host` to another host because it's not my local computer. Now I finally cannot withstand it and decided to fix them once and for all.
* | Add tests for key/deploy key notificationsLin Jen-Shin2016-11-181-0/+12
|/
* Remove instance vars from key model testsSemyon Pupkov2016-11-161-6/+6
|
* Use setter for key instead AR callbackSemyon Pupkov2016-11-161-0/+10
| | | | ref: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6763
* Remove empty describe block on key spec modelSemyon Pupkov2016-10-111-3/+0
|
* adds second batch of tests changed to active tenseactive-tense-test-coveragetiagonbotelho2016-08-091-2/+2
|
* Tidy the key spec and fix failing user specKeith Pope2016-08-021-1/+1
|
* 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
|
* 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
* Fixed Rubocop offensesGabriel Mazetto2015-12-151-1/+1
|
* Tag model specsDouwe Maan2015-12-091-1/+1
|
* Only publish ssh key-type and keyZeger-Jan van de Weg2015-08-041-0/+7
|
* Add error message for SSH key linebreaksNikita Verkhovin2015-07-121-1/+7
|
* ensure_length_of -> validate_length_ofRobert Speicher2015-06-101-2/+2
|
* Re-annotate modelsStan Hu2015-05-031-0/+1
|
* Remove the invalid key factoriesRobert Speicher2015-04-111-4/+9
| | | | They're only used once each, and they're easy to build in-place.
* Updated rspec to rspec 3.x syntaxJeroen van Baarsen2015-02-121-14/+14
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Remove mass assgnment specsDmitriy Zaporozhets2014-06-261-2/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>