Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Abrams <sabrams@gitlab.com>2019-07-22 11:50:25 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-22 11:50:25 +0300
commitaba93fe2d5661cf3c086f65838db2965c746fdbf (patch)
treebe934a757b6b0a64391de1d572f54e16f6ffc82e /app/models/personal_access_token.rb
parent30a0d4600e46af1b01f90332679f64c432219d5a (diff)
OAuth2 support for GitLab personal access tokens
PATs are accepted using the OAuth2 compliant header "Authorization: Bearer {token}" in order to allow for OAuth requests while 2FA is enabled.
Diffstat (limited to 'app/models/personal_access_token.rb')
-rw-r--r--app/models/personal_access_token.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb
index f69f0e2dccb..7ae431eaad7 100644
--- a/app/models/personal_access_token.rb
+++ b/app/models/personal_access_token.rb
@@ -7,6 +7,7 @@ class PersonalAccessToken < ApplicationRecord
add_authentication_token_field :token, digest: true
REDIS_EXPIRY_TIME = 3.minutes
+ TOKEN_LENGTH = 20
serialize :scopes, Array # rubocop:disable Cop/ActiveRecordSerialize