Skip to content
Snippets Groups Projects

Generate JWT for authentication and provide it to CI jobs

Merged Krasimir Angelov requested to merge 207125-ci-jwt-auth into master
1 unresolved thread
Files
10
+ 10
0
@@ -526,6 +526,7 @@ def variables
strong_memoize(:variables) do
Gitlab::Ci::Variables::Collection.new
.concat(persisted_variables)
.tap {|variables| variables.append(ci_job_jwt) if Feature.enabled?(:ci_job_jwt, project, default_enabled: true)}
.concat(scoped_variables)
.concat(job_variables)
.concat(environment_changed_page_variables)
@@ -981,6 +982,15 @@ def options_retry
def has_expiring_artifacts?
artifacts_expire_at.present? && artifacts_expire_at > Time.now
end
def ci_job_jwt
{
key: 'CI_JOB_JWT',
+1
value: Gitlab::Ci::Jwt.for_build(self),
public: false,
masked: true
}
end
end
end
Loading