From 2bb1de180550aad46f5a70e26fe44ff110a5502c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 1 Feb 2017 21:28:43 -0500 Subject: cmd/serve: minor code improve for PR #4078 --- models/ssh_key.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models/ssh_key.go') diff --git a/models/ssh_key.go b/models/ssh_key.go index e2c3431d..94d1bcf2 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -88,6 +88,11 @@ func (key *PublicKey) AuthorizedString() string { return fmt.Sprintf(_TPL_PUBLICK_KEY, setting.AppPath, key.ID, setting.CustomConf, key.Content) } +// IsDeployKey returns true if the public key is used as deploy key. +func (key *PublicKey) IsDeployKey() bool { + return key.Type == KEY_TYPE_DEPLOY +} + func extractTypeFromBase64Key(key string) (string, error) { b, err := base64.StdEncoding.DecodeString(key) if err != nil || len(b) < 4 { -- cgit v1.2.3