File: bcrypt.go

package info (click to toggle)
golang-github-jimstudt-http-authentication 0.0~git20140401.3eca13d-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 284 kB
  • sloc: makefile: 2
file content (15 lines) | stat: -rw-r--r-- 276 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package basic

import (
	"fmt"
	"strings"
)

// Reject any password encoded using bcrypt.
func RejectBcrypt(src string) (EncodedPasswd, error) {
	if strings.HasPrefix(src, "$2y$") {
		return nil, fmt.Errorf("bcrypt passwords are not accepted: %s", src)
	}

	return nil, nil
}