mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Check passwords against HaveIBeenPwned (#12716)
* Implement pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update module Signed-off-by: jolheiser <john.olheiser@gmail.com> * Apply suggestions mrsdizzie Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Add link to HIBP Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add more details to admin command Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add context to pwn Signed-off-by: jolheiser <john.olheiser@gmail.com> * Consistency and making some noise ;) Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
15
vendor/go.jolheiser.com/pwn/error.go
generated
vendored
Normal file
15
vendor/go.jolheiser.com/pwn/error.go
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package pwn
|
||||
|
||||
// ErrEmptyPassword is an empty password error
|
||||
type ErrEmptyPassword struct{}
|
||||
|
||||
// Error fulfills the error interface
|
||||
func (e ErrEmptyPassword) Error() string {
|
||||
return "password cannot be empty"
|
||||
}
|
||||
|
||||
// IsErrEmptyPassword checks if an error is ErrEmptyPassword
|
||||
func IsErrEmptyPassword(err error) bool {
|
||||
_, ok := err.(ErrEmptyPassword)
|
||||
return ok
|
||||
}
|
Reference in New Issue
Block a user