Documentation ¶
Overview ¶
Package iampermission provides primitives for working with IAM permissions. See: https://cloud.google.com/iam/docs/overview#permissions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasWildcard ¶
HasWildcard reports whether an IAM permission contains a wildcard '*' segment.
func Match ¶
Match reports whether the lhs permission name matches the rhs permission. The lhs permission may contain a wildcard. The result will always be false when any of lhs or rhs are invalid, or if rhs contains a wildcard.
func Valid ¶
Valid checks whether the provided permission is valid. See Validate for what constitutes a valid permission.
func Validate ¶
Validate a permission.
A permission is valid on the format `<service>.<resource>.<verb>`.
- It contains at most 3 segments. - When no segment is a wildcard, it contains exactly 3 segments. - All segments are non-empty. - All segments are lower-case. - The first (service) segment is not a wildcard. - A wildcard only occurs in the last segment.