Commit a895bcb7 authored by Tiger's avatar Tiger

Remove ci_jwt_include_environment feature flag

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54168
parent 774a38ed
---
title: Add environment to custom CI_JOB_JWT claims
merge_request: 54168
author:
type: added
---
name: ci_jwt_include_environment
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/53431
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/321206
milestone: '13.9'
type: development
group: group::configure
default_enabled: false
......@@ -53,7 +53,9 @@ The JWT's payload looks like this:
"job_id": "1212", #
"ref": "auto-deploy-2020-04-01", # Git ref for this job
"ref_type": "branch", # Git ref type, branch or tag
"ref_protected": "true" # true if this git ref is protected, false otherwise
"ref_protected": "true", # true if this git ref is protected, false otherwise
"environment": "production", # Environment this job deploys to, if present
"environment_protected": "true" # true if deployed environment is protected, false otherwise
}
```
......
......@@ -60,7 +60,7 @@ module Gitlab
ref_protected: build.protected.to_s
}
if include_environment_claims?
if environment.present?
fields.merge!(
environment: environment.name,
environment_protected: environment_protected?.to_s
......@@ -119,10 +119,6 @@ module Gitlab
def environment_protected?
false # Overridden in EE
end
def include_environment_claims?
Feature.enabled?(:ci_jwt_include_environment) && environment.present?
end
end
end
end
......
......@@ -114,17 +114,6 @@ RSpec.describe Gitlab::Ci::Jwt do
expect(payload[:environment]).to eq('production')
expect(payload[:environment_protected]).to eq('false')
end
context ':ci_jwt_include_environment feature flag is disabled' do
before do
stub_feature_flags(ci_jwt_include_environment: false)
end
it 'does not include environment attributes' do
expect(payload).not_to have_key(:environment)
expect(payload).not_to have_key(:environment_protected)
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment