2019-04-25 04:52:08 +07:00
|
|
|
package authorization
|
|
|
|
|
|
|
|
// Level is the type representing an authorization level.
|
|
|
|
type Level int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Bypass bypass level.
|
|
|
|
Bypass Level = iota
|
|
|
|
// OneFactor one factor level.
|
|
|
|
OneFactor Level = iota
|
|
|
|
// TwoFactor two factor level.
|
|
|
|
TwoFactor Level = iota
|
|
|
|
// Denied denied level.
|
|
|
|
Denied Level = iota
|
|
|
|
)
|
2021-03-05 11:18:31 +07:00
|
|
|
|
2022-04-01 18:38:49 +07:00
|
|
|
const (
|
|
|
|
prefixUser = "user:"
|
|
|
|
prefixGroup = "group:"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
bypass = "bypass"
|
|
|
|
oneFactor = "one_factor"
|
|
|
|
twoFactor = "two_factor"
|
|
|
|
deny = "deny"
|
|
|
|
)
|
2021-04-14 17:53:23 +07:00
|
|
|
|
2022-04-01 18:38:49 +07:00
|
|
|
const (
|
|
|
|
subexpNameUser = "User"
|
|
|
|
subexpNameGroup = "Group"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// IdentitySubexpNames is a list of valid regex subexp names.
|
|
|
|
IdentitySubexpNames = []string{subexpNameUser, subexpNameGroup}
|
|
|
|
)
|
2021-06-18 08:38:01 +07:00
|
|
|
|
2021-04-14 17:53:23 +07:00
|
|
|
const traceFmtACLHitMiss = "ACL %s Position %d for subject %s and object %s (Method %s)"
|