Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a895bcb7
Commit
a895bcb7
authored
Feb 15, 2021
by
Tiger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ci_jwt_include_environment feature flag
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54168
parent
774a38ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
25 deletions
+9
-25
changelogs/unreleased/remove-ci_jwt_include_environment-feature-flag.yml
...leased/remove-ci_jwt_include_environment-feature-flag.yml
+5
-0
config/feature_flags/development/ci_jwt_include_environment.yml
.../feature_flags/development/ci_jwt_include_environment.yml
+0
-8
doc/ci/examples/authenticating-with-hashicorp-vault/index.md
doc/ci/examples/authenticating-with-hashicorp-vault/index.md
+3
-1
lib/gitlab/ci/jwt.rb
lib/gitlab/ci/jwt.rb
+1
-5
spec/lib/gitlab/ci/jwt_spec.rb
spec/lib/gitlab/ci/jwt_spec.rb
+0
-11
No files found.
changelogs/unreleased/remove-ci_jwt_include_environment-feature-flag.yml
0 → 100644
View file @
a895bcb7
---
title
:
Add environment to custom CI_JOB_JWT claims
merge_request
:
54168
author
:
type
:
added
config/feature_flags/development/ci_jwt_include_environment.yml
deleted
100644 → 0
View file @
774a38ed
---
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
doc/ci/examples/authenticating-with-hashicorp-vault/index.md
View file @
a895bcb7
...
...
@@ -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
}
```
...
...
lib/gitlab/ci/jwt.rb
View file @
a895bcb7
...
...
@@ -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
...
...
spec/lib/gitlab/ci/jwt_spec.rb
View file @
a895bcb7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment