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.
|
2022-07-26 12:43:39 +07:00
|
|
|
OneFactor
|
2019-04-25 04:52:08 +07:00
|
|
|
// TwoFactor two factor level.
|
2022-07-26 12:43:39 +07:00
|
|
|
TwoFactor
|
2019-04-25 04:52:08 +07:00
|
|
|
// Denied denied level.
|
2022-07-26 12:43:39 +07:00
|
|
|
Denied
|
2019-04-25 04:52:08 +07:00
|
|
|
)
|
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)"
|