summaryrefslogtreecommitdiff
path: root/app/models/deploy_token.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /app/models/deploy_token.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/models/deploy_token.rb')
-rw-r--r--app/models/deploy_token.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb
index 326d3fb8470..360a9ffbc53 100644
--- a/app/models/deploy_token.rb
+++ b/app/models/deploy_token.rb
@@ -14,6 +14,11 @@ class DeployToken < ApplicationRecord
default_value_for(:expires_at) { Forever.date }
+ # Do NOT use this `user` for the authentication/authorization of the deploy tokens.
+ # It's for the auditing purpose on Credential Inventory, only.
+ # See https://gitlab.com/gitlab-org/gitlab/-/issues/353467#note_859774246 for more information.
+ belongs_to :user, foreign_key: :creator_id, optional: true
+
has_many :project_deploy_tokens, inverse_of: :deploy_token
has_many :projects, through: :project_deploy_tokens