-
Notifications
You must be signed in to change notification settings - Fork 28
/
policy.go
34 lines (30 loc) · 1.52 KB
/
policy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package password
type PolicyName string
const (
// PasswordTooShort is self-explanatory
PasswordTooShort PolicyName = "PasswordTooShort"
// PasswordUppercaseRequired means the password does not contain ASCII uppercase character
PasswordUppercaseRequired PolicyName = "PasswordUppercaseRequired"
// PasswordLowercaseRequired means the password does not contain ASCII lowercase character
PasswordLowercaseRequired PolicyName = "PasswordLowercaseRequired"
// PasswordAlphabetRequired means the password does not contain ASCII alphabet character
PasswordAlphabetRequired PolicyName = "PasswordAlphabetRequired"
// PasswordDigitRequired means the password does not contain ASCII digit character
PasswordDigitRequired PolicyName = "PasswordDigitRequired"
// PasswordSymbolRequired means the password does not contain ASCII non-alphanumeric character
PasswordSymbolRequired PolicyName = "PasswordSymbolRequired"
// PasswordContainingExcludedKeywords means the password contains configured excluded keywords
PasswordContainingExcludedKeywords PolicyName = "PasswordContainingExcludedKeywords"
// PasswordBelowGuessableLevel means the password's guessable level is below configured level.
// The current implementation uses Dropbox's zxcvbn.
PasswordBelowGuessableLevel PolicyName = "PasswordBelowGuessableLevel"
// PasswordReused is self-explanatory
PasswordReused PolicyName = "PasswordReused"
)
type Policy struct {
Name PolicyName
Info map[string]interface{} `json:",omitempty"`
}
func (v Policy) Kind() string {
return string(v.Name)
}