Commit graph

13 commits

Author SHA1 Message Date
Krasimir Angelov
d745ff0431 Add username to deploy tokens
This new attribute is optional and used when set instead of the default
format `gitlab+deploy-token-#{id}`.

Empty usernames will be saved as null in the database.

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/50228.
2019-07-02 18:56:48 +00:00
Thong Kuah
4ec16912b8 Autocorrect with RSpec/ExampleWording cop
- rewords examples starting with 'should'
- rewords examples starting with 'it'

Note: I had to manually fixup "onlies" to "only"
2019-04-05 08:43:27 +00:00
Thong Kuah
a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Bob Van Landuyt
a6268d3023 Fix deploy tokens without expire_at crashes 2018-08-02 19:43:36 +02:00
Mayra Cabrera
f2c46672ca Resolve "Deploy Tokens failed to clone LFS repository" 2018-07-23 09:23:08 +00:00
Mayra Cabrera
cdac54e2a2 Refactor deploy token methods on Ci::Build
Also include a class method for retriving the gitlab_deploy_token on
DeployTokens
2018-04-20 12:18:41 -05:00
Mayra Cabrera
3e35f65394 Verify that deploy token has valid access when pulling container registry image 2018-04-10 07:31:30 +00:00
Mayra Cabrera
5bc58bac26 Handle limit for datetime attributes on MySQL
The TIMESTAMP data type is used for values that contain both date and
time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to
'2038-01-19 03:14:07' UTC.

A Forever lib class was included to handle future dates for PostgreSQL
and MySQL, also changes were made to DeployToken to enforce Forever.date

Also removes extra conditional from JwtController
2018-04-06 22:28:44 -05:00
Mayra Cabrera
c4f56a8802 Increase test suite around deploy tokens behavior
Also, fixes broken specs
2018-04-06 21:20:17 -05:00
Mayra Cabrera
8315861c9a Include ProjectDeployTokens
Also:
- Changes scopes from serializer to use boolean columns
- Fixes broken specs
2018-04-06 21:20:16 -05:00
Mayra Cabrera
171b2625b1 Addreses backend review suggestions
- Remove extra method for authorize_admin_project
- Ensure project presence
- Rename 'read_repo' to 'read_repository' to be more verbose
2018-04-06 21:20:16 -05:00
Mayra Cabrera
370fc05da7 Implement 'read_repo' for DeployTokens
This will allow to download a repo using the token from the DeployToken
2018-04-06 21:20:16 -05:00
Mayra Cabrera
db18993f65 Create barebones for Deploytoken
Includes:
- Model, factories, create service and controller actions
- As usual, includes specs for everything
- Builds UI (copy from PAT)
- Add revoke action

Closes #31591
2018-04-06 21:20:16 -05:00