mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Use fingerprint to check instead content for public key (#911)
* use fingerprint to check instead content for public key * add fingerprint field for ErrKeyAlreadyExist
This commit is contained in:
		| @@ -213,8 +213,9 @@ func (err ErrKeyNotExist) Error() string { | ||||
|  | ||||
| // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error. | ||||
| type ErrKeyAlreadyExist struct { | ||||
| 	OwnerID int64 | ||||
| 	Content string | ||||
| 	OwnerID     int64 | ||||
| 	Fingerprint string | ||||
| 	Content     string | ||||
| } | ||||
|  | ||||
| // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist. | ||||
| @@ -224,7 +225,8 @@ func IsErrKeyAlreadyExist(err error) bool { | ||||
| } | ||||
|  | ||||
| func (err ErrKeyAlreadyExist) Error() string { | ||||
| 	return fmt.Sprintf("public key already exists [owner_id: %d, content: %s]", err.OwnerID, err.Content) | ||||
| 	return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]", | ||||
| 		err.OwnerID, err.Fingerprint, err.Content) | ||||
| } | ||||
|  | ||||
| // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user