1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/internal/authorization/const.go
James Elliott 3c1bb3ec19
feat(authorization): domain regex match with named groups ()
This adds an option to match domains by regex including two special named matching groups. User matches the username of the user, and Group matches the groups a user is a member of. These are both case-insensitive and you can see examples in the docs.
2022-04-01 22:38:49 +11:00

40 lines
765 B
Go

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
)
const (
prefixUser = "user:"
prefixGroup = "group:"
)
const (
bypass = "bypass"
oneFactor = "one_factor"
twoFactor = "two_factor"
deny = "deny"
)
const (
subexpNameUser = "User"
subexpNameGroup = "Group"
)
var (
// IdentitySubexpNames is a list of valid regex subexp names.
IdentitySubexpNames = []string{subexpNameUser, subexpNameGroup}
)
const traceFmtACLHitMiss = "ACL %s Position %d for subject %s and object %s (Method %s)"