mirror of
https://github.com/gogs/gogs.git
synced 2025-12-21 15:50:00 +01:00
cmd/serve: minor code improve for PR #4078
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user