Add signed_file to Debian distributions
What does this MR do?
We need to store:
- the unsigned
Releasefile (infile+file_store), - the detached signature
Release.gpg(infile_signature, in DB), - the inline-signed
InReleasefile (insigned_file+signed_file_store)👈 This MR.
This MR also removes the unused encrypted_signing_keys, which are now in a separate table.
(Discussed here).
Fixes: #335994 (closed).
Migrations
Up :
== 20210720170913 UpdatePackagesDebianGroupDistributions: migrating ===========
-- add_column(:packages_debian_group_distributions, :signed_file, :text)
-> 0.0048s
-- add_column(:packages_debian_group_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
-> 0.0030s
-- remove_column(:packages_debian_group_distributions, :encrypted_signing_keys)
-> 0.0024s
-- remove_column(:packages_debian_group_distributions, :encrypted_signing_keys_iv)
-> 0.0022s
== 20210720170913 UpdatePackagesDebianGroupDistributions: migrated (0.0129s) ==
== 20210720170914 UpdatePackagesDebianProjectDistributions: migrating =========
-- add_column(:packages_debian_project_distributions, :signed_file, :text)
-> 0.0037s
-- add_column(:packages_debian_project_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
-> 0.0023s
-- remove_column(:packages_debian_project_distributions, :encrypted_signing_keys)
-> 0.0020s
-- remove_column(:packages_debian_project_distributions, :encrypted_signing_keys_iv)
-> 0.0016s
== 20210720170914 UpdatePackagesDebianProjectDistributions: migrated (0.0099s)
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: migrating
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0003s
-- execute("ALTER TABLE packages_debian_project_distributions\nADD CONSTRAINT check_9e5e22b7ff\nCHECK ( char_length(signed_file) <= 255 )\nNOT VALID;\n")
-> 0.0008s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE packages_debian_project_distributions VALIDATE CONSTRAINT check_9e5e22b7ff;")
-> 0.0029s
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: migrated (0.0151s)
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: migrating
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0003s
-- execute("ALTER TABLE packages_debian_group_distributions\nADD CONSTRAINT check_0007e0bf61\nCHECK ( char_length(signed_file) <= 255 )\nNOT VALID;\n")
-> 0.0009s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE packages_debian_group_distributions VALIDATE CONSTRAINT check_0007e0bf61;")
-> 0.0028s
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: migrated (0.0133s)
Down:
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: reverting
-- execute("ALTER TABLE packages_debian_group_distributions\nDROP CONSTRAINT IF EXISTS check_0007e0bf61\n")
-> 0.0030s
== 20210720170916 AddTextLimitToPackagesDebianGroupDistributionsSignedFile: reverted (0.0193s)
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: reverting
-- execute("ALTER TABLE packages_debian_project_distributions\nDROP CONSTRAINT IF EXISTS check_9e5e22b7ff\n")
-> 0.0027s
== 20210720170915 AddTextLimitToPackagesDebianProjectDistributionsSignedFile: reverted (0.0129s)
== 20210720170914 UpdatePackagesDebianProjectDistributions: reverting =========
-- add_column(:packages_debian_project_distributions, :encrypted_signing_keys_iv, :text)
-> 0.0066s
-- add_column(:packages_debian_project_distributions, :encrypted_signing_keys, :text)
-> 0.0028s
-- remove_column(:packages_debian_project_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
-> 0.0027s
-- remove_column(:packages_debian_project_distributions, :signed_file, :text)
-> 0.0030s
== 20210720170914 UpdatePackagesDebianProjectDistributions: reverted (0.0191s)
== 20210720170913 UpdatePackagesDebianGroupDistributions: reverting ===========
-- add_column(:packages_debian_group_distributions, :encrypted_signing_keys_iv, :text)
-> 0.0054s
-- add_column(:packages_debian_group_distributions, :encrypted_signing_keys, :text)
-> 0.0037s
-- remove_column(:packages_debian_group_distributions, :signed_file_store, :integer, {:limit=>2, :default=>1, :null=>false})
-> 0.0045s
-- remove_column(:packages_debian_group_distributions, :signed_file, :text)
-> 0.0039s
== 20210720170913 UpdatePackagesDebianGroupDistributions: reverted (0.0211s) ==
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec -
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Mathieu Parent