forked from forgejo/forgejo
Rework SSH key management UI to add GPG (#1293)
* Rework SSH key management UI to add GPG * Add more detail to gpg key display * Update CHANGELOG.md * Implement deletion UI * Implement adding gpg UI * Various fixes - Fix duplicate entry in locale - Re-generate hash before verification since they are consumed * Add missing translation * Split template * Catch not found/verified email error
This commit is contained in:
parent
b7da5a6cb7
commit
8371f94d06
14 changed files with 324 additions and 140 deletions
|
@ -260,6 +260,36 @@ func (err ErrKeyNameAlreadyUsed) Error() string {
|
|||
return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
|
||||
}
|
||||
|
||||
// ErrGPGEmailNotFound represents a "ErrGPGEmailNotFound" kind of error.
|
||||
type ErrGPGEmailNotFound struct {
|
||||
Email string
|
||||
}
|
||||
|
||||
// IsErrGPGEmailNotFound checks if an error is a ErrGPGEmailNotFound.
|
||||
func IsErrGPGEmailNotFound(err error) bool {
|
||||
_, ok := err.(ErrGPGEmailNotFound)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrGPGEmailNotFound) Error() string {
|
||||
return fmt.Sprintf("failed to found email or is not confirmed : %s", err.Email)
|
||||
}
|
||||
|
||||
// ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
|
||||
type ErrGPGKeyParsing struct {
|
||||
ParseError error
|
||||
}
|
||||
|
||||
// IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
|
||||
func IsErrGPGKeyParsing(err error) bool {
|
||||
_, ok := err.(ErrGPGKeyParsing)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrGPGKeyParsing) Error() string {
|
||||
return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
|
||||
}
|
||||
|
||||
// ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
|
||||
type ErrGPGKeyNotExist struct {
|
||||
ID int64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue