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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
fa33a2ee
Commit
fa33a2ee
authored
Nov 16, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encrypt group / project runners registration tokens
parent
0df989ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
3 deletions
+29
-3
app/models/group.rb
app/models/group.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-1
db/migrate/20181116141415_add_encrypted_runners_token_to_namespaces.rb
...181116141415_add_encrypted_runners_token_to_namespaces.rb
+12
-0
db/migrate/20181116141504_add_encrypted_runners_token_to_projects.rb
...20181116141504_add_encrypted_runners_token_to_projects.rb
+12
-0
db/schema.rb
db/schema.rb
+3
-1
No files found.
app/models/group.rb
View file @
fa33a2ee
...
...
@@ -55,7 +55,7 @@ class Group < Namespace
validates
:two_factor_grace_period
,
presence:
true
,
numericality:
{
greater_than_or_equal_to:
0
}
add_authentication_token_field
:runners_token
add_authentication_token_field
:runners_token
,
encrypted:
true
,
fallback:
true
after_create
:post_create_hook
after_destroy
:post_destroy_hook
...
...
app/models/project.rb
View file @
fa33a2ee
...
...
@@ -76,7 +76,7 @@ class Project < ActiveRecord::Base
default_value_for
:snippets_enabled
,
gitlab_config_features
.
snippets
default_value_for
:only_allow_merge_if_all_discussions_are_resolved
,
false
add_authentication_token_field
:runners_token
add_authentication_token_field
:runners_token
,
encrypted:
true
,
fallback:
true
before_validation
:mark_remote_mirrors_for_removal
,
if:
->
{
RemoteMirror
.
table_exists?
}
...
...
db/migrate/20181116141415_add_encrypted_runners_token_to_namespaces.rb
0 → 100644
View file @
fa33a2ee
# frozen_string_literal: true
class
AddEncryptedRunnersTokenToNamespaces
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
add_column
:namespaces
,
:runners_token_encrypted
,
:string
# TODO index
end
end
db/migrate/20181116141504_add_encrypted_runners_token_to_projects.rb
0 → 100644
View file @
fa33a2ee
# frozen_string_literal: true
class
AddEncryptedRunnersTokenToProjects
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
add_column
:projects
,
:runners_token_encrypted
,
:string
# TODO index
end
end
db/schema.rb
View file @
fa33a2ee
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2018111
5140140
)
do
ActiveRecord
::
Schema
.
define
(
version:
2018111
6141504
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -1409,6 +1409,7 @@ ActiveRecord::Schema.define(version: 20181115140140) do
t
.
integer
"two_factor_grace_period"
,
default:
48
,
null:
false
t
.
integer
"cached_markdown_version"
t
.
string
"runners_token"
t
.
string
"runners_token_encrypted"
end
add_index
"namespaces"
,
[
"created_at"
],
name:
"index_namespaces_on_created_at"
,
using: :btree
...
...
@@ -1753,6 +1754,7 @@ ActiveRecord::Schema.define(version: 20181115140140) do
t
.
boolean
"pages_https_only"
,
default:
true
t
.
boolean
"remote_mirror_available_overridden"
t
.
integer
"pool_repository_id"
,
limit:
8
t
.
string
"runners_token_encrypted"
end
add_index
"projects"
,
[
"ci_id"
],
name:
"index_projects_on_ci_id"
,
using: :btree
...
...
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