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
100fba9e
Commit
100fba9e
authored
Jan 02, 2020
by
Matt Kasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add istio cert and key to ServerlessDomainCluster
Relates to
https://gitlab.com/gitlab-org/gitlab/issues/33559
parent
d4ec60e0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
0 deletions
+65
-0
app/models/serverless/domain_cluster.rb
app/models/serverless/domain_cluster.rb
+5
-0
db/migrate/20200130134335_add_cert_and_key_to_serverless_domain_cluster.rb
...30134335_add_cert_and_key_to_serverless_domain_cluster.rb
+13
-0
db/schema.rb
db/schema.rb
+3
-0
spec/factories/serverless/domain_cluster.rb
spec/factories/serverless/domain_cluster.rb
+36
-0
spec/models/serverless/domain_cluster_spec.rb
spec/models/serverless/domain_cluster_spec.rb
+8
-0
No files found.
app/models/serverless/domain_cluster.rb
View file @
100fba9e
...
@@ -10,6 +10,11 @@ module Serverless
...
@@ -10,6 +10,11 @@ module Serverless
belongs_to
:knative
,
class_name:
'Clusters::Applications::Knative'
,
foreign_key:
'clusters_applications_knative_id'
belongs_to
:knative
,
class_name:
'Clusters::Applications::Knative'
,
foreign_key:
'clusters_applications_knative_id'
belongs_to
:creator
,
class_name:
'User'
,
optional:
true
belongs_to
:creator
,
class_name:
'User'
,
optional:
true
attr_encrypted
:key
,
mode: :per_attribute_iv
,
key:
Settings
.
attr_encrypted_db_key_base_truncated
,
algorithm:
'aes-256-gcm'
validates
:pages_domain
,
:knative
,
presence:
true
validates
:pages_domain
,
:knative
,
presence:
true
validates
:uuid
,
presence:
true
,
uniqueness:
true
,
length:
{
is:
Gitlab
::
Serverless
::
Domain
::
UUID_LENGTH
},
validates
:uuid
,
presence:
true
,
uniqueness:
true
,
length:
{
is:
Gitlab
::
Serverless
::
Domain
::
UUID_LENGTH
},
format:
{
with:
HEX_REGEXP
,
message:
'only allows hex characters'
}
format:
{
with:
HEX_REGEXP
,
message:
'only allows hex characters'
}
...
...
db/migrate/20200130134335_add_cert_and_key_to_serverless_domain_cluster.rb
0 → 100644
View file @
100fba9e
# frozen_string_literal: true
class
AddCertAndKeyToServerlessDomainCluster
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
add_column
:serverless_domain_cluster
,
:encrypted_key
,
:text
add_column
:serverless_domain_cluster
,
:encrypted_key_iv
,
:string
,
limit:
255
add_column
:serverless_domain_cluster
,
:certificate
,
:text
end
end
db/schema.rb
View file @
100fba9e
...
@@ -3758,6 +3758,9 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
...
@@ -3758,6 +3758,9 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t
.
bigint
"creator_id"
t
.
bigint
"creator_id"
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
text
"encrypted_key"
t
.
string
"encrypted_key_iv"
,
limit:
255
t
.
text
"certificate"
t
.
index
[
"clusters_applications_knative_id"
],
name:
"idx_serverless_domain_cluster_on_clusters_applications_knative"
,
unique:
true
t
.
index
[
"clusters_applications_knative_id"
],
name:
"idx_serverless_domain_cluster_on_clusters_applications_knative"
,
unique:
true
t
.
index
[
"creator_id"
],
name:
"index_serverless_domain_cluster_on_creator_id"
t
.
index
[
"creator_id"
],
name:
"index_serverless_domain_cluster_on_creator_id"
t
.
index
[
"pages_domain_id"
],
name:
"index_serverless_domain_cluster_on_pages_domain_id"
t
.
index
[
"pages_domain_id"
],
name:
"index_serverless_domain_cluster_on_pages_domain_id"
...
...
spec/factories/serverless/domain_cluster.rb
View file @
100fba9e
...
@@ -5,5 +5,41 @@ FactoryBot.define do
...
@@ -5,5 +5,41 @@ FactoryBot.define do
pages_domain
{
create
(
:pages_domain
)
}
pages_domain
{
create
(
:pages_domain
)
}
knative
{
create
(
:clusters_applications_knative
)
}
knative
{
create
(
:clusters_applications_knative
)
}
creator
{
create
(
:user
)
}
creator
{
create
(
:user
)
}
certificate
do
'-----BEGIN CERTIFICATE-----
MIICGzCCAYSgAwIBAgIBATANBgkqhkiG9w0BAQUFADAbMRkwFwYDVQQDExB0ZXN0
LWNlcnRpZmljYXRlMB4XDTE2MDIxMjE0MzIwMFoXDTIwMDQxMjE0MzIwMFowGzEZ
MBcGA1UEAxMQdGVzdC1jZXJ0aWZpY2F0ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEApL4J9L0ZxFJ1hI1LPIflAlAGvm6ZEvoT4qKU5Xf2JgU7/2geNR1qlNFa
SvCc08Knupp5yTgmvyK/Xi09U0N82vvp4Zvr/diSc4A/RA6Mta6egLySNT438kdT
nY2tR5feoTLwQpX0t4IMlwGQGT5h6Of2fKmDxzuwuyffcIHqLdsCAwEAAaNvMG0w
DAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUxl9WSxBprB0z0ibJs3rXEk0+95AwCwYD
VR0PBAQDAgXgMBEGCWCGSAGG+EIBAQQEAwIGQDAeBglghkgBhvhCAQ0EERYPeGNh
IGNlcnRpZmljYXRlMA0GCSqGSIb3DQEBBQUAA4GBAGC4T8SlFHK0yPSa+idGLQFQ
joZp2JHYvNlTPkRJ/J4TcXxBTJmArcQgTIuNoBtC+0A/SwdK4MfTCUY4vNWNdese
5A4K65Nb7Oh1AdQieTBHNXXCdyFsva9/ScfQGEl7p55a52jOPs0StPd7g64uvjlg
YHi2yesCrOvVXt+lgPTd
-----END CERTIFICATE-----'
end
key
do
'-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKS+CfS9GcRSdYSN
SzyH5QJQBr5umRL6E+KilOV39iYFO/9oHjUdapTRWkrwnNPCp7qaeck4Jr8iv14t
PVNDfNr76eGb6/3YknOAP0QOjLWunoC8kjU+N/JHU52NrUeX3qEy8EKV9LeCDJcB
kBk+Yejn9nypg8c7sLsn33CB6i3bAgMBAAECgYA2D26w80T7WZvazYr86BNMePpd
j2mIAqx32KZHzt/lhh40J/SRtX9+Kl0Y7nBoRR5Ja9u/HkAIxNxLiUjwg9r6cpg/
uITEF5nMt7lAk391BuI+7VOZZGbJDsq2ulPd6lO+C8Kq/PI/e4kXcIjeH6KwQsuR
5vrXfBZ3sQfflaiN4QJBANBt8JY2LIGQF8o89qwUpRL5vbnKQ4IzZ5+TOl4RLR7O
AQpJ81tGuINghO7aunctb6rrcKJrxmEH1whzComybrMCQQDKV49nOBudRBAIgG4K
EnLzsRKISUHMZSJiYTYnablof8cKw1JaQduw7zgrUlLwnroSaAGX88+Jw1f5n2Lh
Vlg5AkBDdUGnrDLtYBCDEQYZHblrkc7ZAeCllDOWjxUV+uMqlCv8A4Ey6omvY57C
m6I8DkWVAQx8VPtozhvHjUw80rZHAkB55HWHAM3h13axKG0htCt7klhPsZHpx6MH
EPjGlXIT+aW2XiPmK3ZlCDcWIenE+lmtbOpI159Wpk8BGXs/s/xBAkEAlAY3ymgx
63BDJEwvOb2IaP8lDDxNsXx9XJNVvQbv5n15vNsLHbjslHfAhAbxnLQ1fLhUPqSi
nNp/xedE1YxutQ==
-----END PRIVATE KEY-----'
end
end
end
end
end
spec/models/serverless/domain_cluster_spec.rb
View file @
100fba9e
...
@@ -50,4 +50,12 @@ describe ::Serverless::DomainCluster do
...
@@ -50,4 +50,12 @@ describe ::Serverless::DomainCluster do
describe
'domain'
do
describe
'domain'
do
it
{
is_expected
.
to
respond_to
(
:domain
)
}
it
{
is_expected
.
to
respond_to
(
:domain
)
}
end
end
describe
'certificate'
do
it
{
is_expected
.
to
respond_to
(
:certificate
)
}
end
describe
'key'
do
it
{
is_expected
.
to
respond_to
(
:key
)
}
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