Documentation ¶
Overview ¶
Package roles are part of the Skia Infra Authorization system.
See go/proxy-auth-skia.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Role ¶
type Role string
Role for an authorized user.
const ( // Viewer has read-only access to the application. Viewer Role = "viewer" // Editor has read-write access to the application. Editor Role = "editor" // Admin has admin access to the application. Admin Role = "admin" // Bisecter can request a bisection. Bisecter Role = "bisecter" // Buildbucket represents the Buildbucket service. Buildbucket Role = "buildbucket" // LuciConfig represents the LUCI Config service account. LuciConfig Role = "luci_config" )
const ( // InvalidRole signals an invalid Role. InvalidRole Role = "" )
func RoleFromString ¶
RoleFromString converts a string to a Role, returning InvalidRole, which is the empty string, if the passed in value is not a valid role.
type Roles ¶
type Roles []Role
Roles is a slice of Role.
var ( // AllValidRoles is all valid Roles. AllValidRoles Roles = []Role{Viewer, Editor, Admin, Bisecter, Buildbucket, LuciConfig} // AllRoles is all Roles including InvalidRole. AllRoles Roles = append(AllValidRoles, InvalidRole) )
func FromHeader ¶
FromHeader parses a Roles header value and returns Roles found.
func RolesFromStrings ¶
RolesFromStrings parses multiple string values and returns Roles found.
func (Roles) IsAuthorized ¶
IsAuthorized returns true if r and in contain any of the same roles. Note that if either r or in is empty, this will return false.
Click to show internal directories.
Click to hide internal directories.