mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-15 19:42:04 +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:
parent
bea343ce09
commit
c6e4bc53aa
22 changed files with 309 additions and 8 deletions
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue