Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultUserName = "mock"
View Source
const MockExtraKey = "github.com/UiP9AV6Y/go-k8s-user-authz"
MockExtraKey is the key used for the MockUser extra values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockUser ¶
type MockUser []string
MockUser implements [user.Info] and is inteded for testing purposes. Its value is the user name.
func NewMockUser ¶
NewMockUser returns a MockUser instance with the given name.
func (MockUser) GetExtra ¶
GetExtra returns a map with a single key: MockExtraKey. The value of that map entry is MockUser.GetGroups.
func (MockUser) GetName ¶
GetName returns the first item of u, or DefaultUserName if its length is zero.
func (MockUser) GetUID ¶
GetUID returns a hash of u. It uses crc64.Checksum to generate a numeric value of the MockUser.GetName, which is then converted to a string using strconv.FormatUint.
Click to show internal directories.
Click to hide internal directories.