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
Jérome Perrin
gitlab-ce
Commits
8e0c33ed
Commit
8e0c33ed
authored
Jul 20, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ShaAttribute for gpg table columns
parent
8c8a9e6d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
10 deletions
+25
-10
app/models/gpg_key.rb
app/models/gpg_key.rb
+5
-0
app/models/gpg_signature.rb
app/models/gpg_signature.rb
+5
-0
app/views/profiles/gpg_keys/_key.html.haml
app/views/profiles/gpg_keys/_key.html.haml
+1
-1
app/views/projects/commit/_signature_badge.html.haml
app/views/projects/commit/_signature_badge.html.haml
+1
-1
db/migrate/20170222111732_create_gpg_keys.rb
db/migrate/20170222111732_create_gpg_keys.rb
+2
-2
db/migrate/20170613154149_create_gpg_signatures.rb
db/migrate/20170613154149_create_gpg_signatures.rb
+3
-2
db/migrate/limits_to_mysql.rb
db/migrate/limits_to_mysql.rb
+4
-0
db/schema.rb
db/schema.rb
+4
-4
No files found.
app/models/gpg_key.rb
View file @
8e0c33ed
class
GpgKey
<
ActiveRecord
::
Base
class
GpgKey
<
ActiveRecord
::
Base
KEY_PREFIX
=
'-----BEGIN PGP PUBLIC KEY BLOCK-----'
.
freeze
KEY_PREFIX
=
'-----BEGIN PGP PUBLIC KEY BLOCK-----'
.
freeze
include
ShaAttribute
sha_attribute
:primary_keyid
sha_attribute
:fingerprint
belongs_to
:user
belongs_to
:user
has_many
:gpg_signatures
,
dependent: :nullify
has_many
:gpg_signatures
,
dependent: :nullify
...
...
app/models/gpg_signature.rb
View file @
8e0c33ed
class
GpgSignature
<
ActiveRecord
::
Base
class
GpgSignature
<
ActiveRecord
::
Base
include
ShaAttribute
sha_attribute
:commit_sha
sha_attribute
:gpg_key_primary_keyid
belongs_to
:project
belongs_to
:project
belongs_to
:gpg_key
belongs_to
:gpg_key
...
...
app/views/profiles/gpg_keys/_key.html.haml
View file @
8e0c33ed
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
=
render
partial:
'email_with_badge'
,
locals:
{
email:
email
,
verified:
verified
}
=
render
partial:
'email_with_badge'
,
locals:
{
email:
email
,
verified:
verified
}
.description
.description
%code
=
key
.
fingerprint
%code
=
key
.
fingerprint
.
upcase
.pull-right
.pull-right
%span
.key-created-at
%span
.key-created-at
created
#{
time_ago_with_tooltip
(
key
.
created_at
)
}
created
#{
time_ago_with_tooltip
(
key
.
created_at
)
}
...
...
app/views/projects/commit/_signature_badge.html.haml
View file @
8e0c33ed
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
=
content
=
content
GPG Key ID:
GPG Key ID:
%span
.monospace
=
signature
.
gpg_key_primary_keyid
%span
.monospace
=
signature
.
gpg_key_primary_keyid
.
upcase
=
link_to
(
'Learn more about signing commits'
,
help_page_path
(
'workflow/gpg_signed_commits/index.md'
),
class:
'gpg-popover-help-link'
)
=
link_to
(
'Learn more about signing commits'
,
help_page_path
(
'workflow/gpg_signed_commits/index.md'
),
class:
'gpg-popover-help-link'
)
...
...
db/migrate/20170222111732_create_gpg_keys.rb
View file @
8e0c33ed
...
@@ -7,8 +7,8 @@ class CreateGpgKeys < ActiveRecord::Migration
...
@@ -7,8 +7,8 @@ class CreateGpgKeys < ActiveRecord::Migration
t
.
references
:user
,
index:
true
,
foreign_key:
true
t
.
references
:user
,
index:
true
,
foreign_key:
true
t
.
string
:fingerprint
t
.
binary
:primary_keyid
,
limit:
Gitlab
::
Database
.
mysql?
?
20
:
nil
t
.
string
:primary_keyid
t
.
binary
:fingerprint
,
limit:
Gitlab
::
Database
.
mysql?
?
20
:
nil
t
.
text
:key
t
.
text
:key
...
...
db/migrate/20170613154149_create_gpg_signatures.rb
View file @
8e0c33ed
...
@@ -10,8 +10,9 @@ class CreateGpgSignatures < ActiveRecord::Migration
...
@@ -10,8 +10,9 @@ class CreateGpgSignatures < ActiveRecord::Migration
t
.
boolean
:valid_signature
t
.
boolean
:valid_signature
t
.
string
:commit_sha
t
.
binary
:commit_sha
,
limit:
Gitlab
::
Database
.
mysql?
?
20
:
nil
t
.
string
:gpg_key_primary_keyid
t
.
binary
:gpg_key_primary_keyid
,
limit:
Gitlab
::
Database
.
mysql?
?
20
:
nil
t
.
string
:gpg_key_user_name
t
.
string
:gpg_key_user_name
t
.
string
:gpg_key_user_email
t
.
string
:gpg_key_user_email
...
...
db/migrate/limits_to_mysql.rb
View file @
8e0c33ed
...
@@ -8,5 +8,9 @@ class LimitsToMysql < ActiveRecord::Migration
...
@@ -8,5 +8,9 @@ class LimitsToMysql < ActiveRecord::Migration
change_column
:snippets
,
:content
,
:text
,
limit:
2147483647
change_column
:snippets
,
:content
,
:text
,
limit:
2147483647
change_column
:notes
,
:st_diff
,
:text
,
limit:
2147483647
change_column
:notes
,
:st_diff
,
:text
,
limit:
2147483647
change_column
:events
,
:data
,
:text
,
limit:
2147483647
change_column
:events
,
:data
,
:text
,
limit:
2147483647
change_column
:gpg_keys
,
:primary_keyid
,
:binary
,
limit:
20
change_column
:gpg_keys
,
:fingerprint
,
:binary
,
limit:
20
change_column
:gpg_signatures
,
:commit_sha
,
:binary
,
limit:
20
change_column
:gpg_signatures
,
:gpg_key_primary_keyid
,
:binary
,
limit:
20
end
end
end
end
db/schema.rb
View file @
8e0c33ed
...
@@ -544,8 +544,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
...
@@ -544,8 +544,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"user_id"
t
.
integer
"user_id"
t
.
string
"fingerprint
"
t
.
binary
"primary_keyid
"
t
.
string
"primary_keyid
"
t
.
binary
"fingerprint
"
t
.
text
"key"
t
.
text
"key"
end
end
...
@@ -558,8 +558,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
...
@@ -558,8 +558,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
t
.
integer
"project_id"
t
.
integer
"project_id"
t
.
integer
"gpg_key_id"
t
.
integer
"gpg_key_id"
t
.
boolean
"valid_signature"
t
.
boolean
"valid_signature"
t
.
string
"commit_sha"
t
.
binary
"commit_sha"
t
.
string
"gpg_key_primary_keyid"
t
.
binary
"gpg_key_primary_keyid"
t
.
string
"gpg_key_user_name"
t
.
string
"gpg_key_user_name"
t
.
string
"gpg_key_user_email"
t
.
string
"gpg_key_user_email"
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