diff options
author | Unknwon <u@gogs.io> | 2017-02-01 21:28:43 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-01 21:28:43 -0500 |
commit | 2bb1de180550aad46f5a70e26fe44ff110a5502c (patch) | |
tree | 08ea4670b9ddb4a746ec4b2a2d7c29176072c83d /models | |
parent | 0081c6911d7ea28eb617b56e32012ba4dc9af90b (diff) |
cmd/serve: minor code improve for PR #4078
Diffstat (limited to 'models')
-rw-r--r-- | models/ssh_key.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 { |