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
78c0e901
Commit
78c0e901
authored
Jun 16, 2020
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '214607-ci-jwt-signing-key/check' into 'master'"
This reverts merge request !33920
parent
da918859
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
66 deletions
+1
-66
changelogs/unreleased/214607-ci-jwt-signing-key-check.yml
changelogs/unreleased/214607-ci-jwt-signing-key-check.yml
+0
-5
lib/system_check/app/ci_jwt_signing_key_check.rb
lib/system_check/app/ci_jwt_signing_key_check.rb
+0
-30
lib/system_check/rake_task/app_task.rb
lib/system_check/rake_task/app_task.rb
+1
-2
spec/lib/system_check/app/ci_jwt_signing_key_check_spec.rb
spec/lib/system_check/app/ci_jwt_signing_key_check_spec.rb
+0
-29
No files found.
changelogs/unreleased/214607-ci-jwt-signing-key-check.yml
deleted
100644 → 0
View file @
da918859
---
title
:
Add system check for CI JWT signing key
merge_request
:
33920
author
:
type
:
added
lib/system_check/app/ci_jwt_signing_key_check.rb
deleted
100644 → 0
View file @
da918859
# frozen_string_literal: true
module
SystemCheck
module
App
class
CiJwtSigningKeyCheck
<
SystemCheck
::
BaseCheck
set_name
'Valid CI JWT signing key?'
def
check?
key_data
=
Rails
.
application
.
secrets
.
ci_jwt_signing_key
return
false
unless
key_data
.
present?
OpenSSL
::
PKey
::
RSA
.
new
(
key_data
)
true
rescue
OpenSSL
::
PKey
::
RSAError
false
end
def
show_error
$stdout
.
puts
' Rails.application.secrets.ci_jwt_signing_key is missing or not a valid RSA key.'
.
color
(
:red
)
$stdout
.
puts
' CI_JOB_JWT will not be generated for CI jobs.'
.
color
(
:red
)
for_more_information
(
'doc/ci/variables/predefined_variables.md'
,
'doc/ci/examples/authenticating-with-hashicorp-vault/index.md'
)
end
end
end
end
lib/system_check/rake_task/app_task.rb
View file @
78c0e901
...
...
@@ -33,8 +33,7 @@ module SystemCheck
SystemCheck
::
App
::
ActiveUsersCheck
,
SystemCheck
::
App
::
AuthorizedKeysPermissionCheck
,
SystemCheck
::
App
::
HashedStorageEnabledCheck
,
SystemCheck
::
App
::
HashedStorageAllProjectsCheck
,
SystemCheck
::
App
::
CiJwtSigningKeyCheck
SystemCheck
::
App
::
HashedStorageAllProjectsCheck
]
end
end
...
...
spec/lib/system_check/app/ci_jwt_signing_key_check_spec.rb
deleted
100644 → 0
View file @
da918859
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
SystemCheck
::
App
::
CiJwtSigningKeyCheck
do
subject
(
:system_check
)
{
described_class
.
new
}
describe
'#check?'
do
it
'returns false when key is not present'
do
expect
(
Rails
.
application
.
secrets
).
to
receive
(
:ci_jwt_signing_key
).
and_return
(
nil
)
expect
(
system_check
.
check?
).
to
eq
(
false
)
end
it
'returns false when key is not valid RSA key'
do
invalid_key
=
OpenSSL
::
PKey
::
RSA
.
new
(
1024
).
to_s
.
delete
(
"
\n
"
)
expect
(
Rails
.
application
.
secrets
).
to
receive
(
:ci_jwt_signing_key
).
and_return
(
invalid_key
)
expect
(
system_check
.
check?
).
to
eq
(
false
)
end
it
'returns true when key is valid RSA key'
do
valid_key
=
OpenSSL
::
PKey
::
RSA
.
new
(
1024
).
to_s
expect
(
Rails
.
application
.
secrets
).
to
receive
(
:ci_jwt_signing_key
).
and_return
(
valid_key
)
expect
(
system_check
.
check?
).
to
eq
(
true
)
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