apiserver: k8s.io/apiserver/pkg/authentication/serviceaccount Index | Files

package serviceaccount

import "k8s.io/apiserver/pkg/authentication/serviceaccount"

Index

Package Files

util.go

Constants

const (
    ServiceAccountUsernamePrefix    = "system:serviceaccount:"
    ServiceAccountUsernameSeparator = ":"
    ServiceAccountGroupPrefix       = "system:serviceaccounts:"
    AllServiceAccountsGroup         = "system:serviceaccounts"
)

func MakeGroupNames Uses

func MakeGroupNames(namespace string) []string

MakeGroupNames generates service account group names for the given namespace

func MakeNamespaceGroupName Uses

func MakeNamespaceGroupName(namespace string) string

MakeNamespaceGroupName returns the name of the group all service accounts in the namespace are included in

func MakeUsername Uses

func MakeUsername(namespace, name string) string

MakeUsername generates a username from the given namespace and ServiceAccount name. The resulting username can be passed to SplitUsername to extract the original namespace and ServiceAccount name.

func MatchesUsername Uses

func MatchesUsername(namespace, name string, username string) bool

MatchesUsername checks whether the provided username matches the namespace and name without allocating. Use this when checking a service account namespace and name against a known string.

func SplitUsername Uses

func SplitUsername(username string) (string, string, error)

SplitUsername returns the namespace and ServiceAccount name embedded in the given username, or an error if the username is not a valid name produced by MakeUsername

Package serviceaccount imports 3 packages (graph) and is imported by 421 packages. Updated 2019-05-08. Refresh now. Tools for package owners.