Documentation
¶
Index ¶
- func GetServiceAccountFullName(ref meta.NamespacedRFC1123ObjectReferenceWithNamespace) string
- func GetServiceAccountGroups(namespace string) []string
- func HasIgnoredGroup(userGroups []string, ignoredGroups []string) bool
- func ImpersonatedKubernetesClientForServiceAccount(base *rest.Config, scheme *runtime.Scheme, ...) (client.Client, error)
- func IsAdminUser(req admission.Request, administrators rbac.UserListSpec) bool
- func IsCapsuleUser(ctx context.Context, c client.Client, cfg configuration.Configuration, ...) bool
- func IsCommonOwner(ctx context.Context, c client.Reader, cfg configuration.Configuration, ...) (bool, error)
- func IsControllerServiceAccount(username string) bool
- func IsTenantOwner(ctx context.Context, c client.Reader, cfg configuration.Configuration, ...) (bool, error)
- func IsTenantOwnerByStatus(tnt *capsulev1beta2.Tenant, user AdmissionUser) bool
- func ResolveServiceAccountActor(ctx context.Context, c client.Reader, ns *corev1.Namespace, username string, ...) (tnt *capsulev1beta2.Tenant, err error)
- func ServiceAccountGroups(namespace string) []string
- func ServiceAccountUserInfo(namespace, name string) authenticationv1.UserInfo
- func ServiceAccountUsername(namespace, name string) string
- type AdmissionServiceAccount
- type AdmissionUser
- type AdmissionUserType
- type UserGroupList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceAccountFullName ¶
func GetServiceAccountFullName(ref meta.NamespacedRFC1123ObjectReferenceWithNamespace) string
GetServiceAccountFullName return the full qualified name for the serviceaccount.
func GetServiceAccountGroups ¶
GetServiceAccountGroups returns all groups associated with a ServiceAccount.
func HasIgnoredGroup ¶
func ImpersonatedKubernetesClientForServiceAccount ¶
func ImpersonatedKubernetesClientForServiceAccount( base *rest.Config, scheme *runtime.Scheme, reference meta.NamespacedRFC1123ObjectReferenceWithNamespace, ) (client.Client, error)
ImpersonatedKubernetesClientForServiceAccount returns a controller-runtime client.Client that impersonates a given ServiceAccount.
func IsAdminUser ¶
func IsAdminUser(req admission.Request, administrators rbac.UserListSpec) bool
func IsCapsuleUser ¶
func IsCapsuleUser( ctx context.Context, c client.Client, cfg configuration.Configuration, user string, groups []string, ) bool
func IsCommonOwner ¶
func IsCommonOwner( ctx context.Context, c client.Reader, cfg configuration.Configuration, tnt *capsulev1beta2.Tenant, userInfo authenticationv1.UserInfo, ) (bool, error)
func IsTenantOwner ¶
func IsTenantOwner( ctx context.Context, c client.Reader, cfg configuration.Configuration, tnt *capsulev1beta2.Tenant, userInfo authenticationv1.UserInfo, ) (bool, error)
func IsTenantOwnerByStatus ¶
func IsTenantOwnerByStatus( tnt *capsulev1beta2.Tenant, user AdmissionUser, ) bool
func ResolveServiceAccountActor ¶
func ResolveServiceAccountActor( ctx context.Context, c client.Reader, ns *corev1.Namespace, username string, cfg configuration.Configuration, ) (tnt *capsulev1beta2.Tenant, err error)
This function resolves the tenant based on the serviceaccount given via username if a serviceaccount is in a tenant namespace they will return the tenant.
func ServiceAccountGroups ¶
func ServiceAccountUserInfo ¶
func ServiceAccountUserInfo(namespace, name string) authenticationv1.UserInfo
func ServiceAccountUsername ¶
Types ¶
type AdmissionServiceAccount ¶
func ToServiceAccount ¶
func ToServiceAccount(username string) *AdmissionServiceAccount
type AdmissionUser ¶
type AdmissionUser struct {
Type AdmissionUserType
Username string
Groups []string
ServiceAccount *AdmissionServiceAccount
}
func NewAdmissionUser ¶
func NewAdmissionUser(userType AdmissionUserType, info authenticationv1.UserInfo) AdmissionUser
func (AdmissionUser) IsAdmin ¶
func (u AdmissionUser) IsAdmin() bool
func (AdmissionUser) IsCapsule ¶
func (u AdmissionUser) IsCapsule() bool
func (AdmissionUser) IsControllerServiceAccount ¶
func (u AdmissionUser) IsControllerServiceAccount() bool
func (AdmissionUser) IsUnknown ¶
func (u AdmissionUser) IsUnknown() bool
func (AdmissionUser) UserInfo ¶
func (u AdmissionUser) UserInfo() authenticationv1.UserInfo
type AdmissionUserType ¶
type AdmissionUserType string
const ( AdmissionUserUnknown AdmissionUserType = "Unknown" AdmissionUserAdmin AdmissionUserType = "Admin" AdmissionUserCapsule AdmissionUserType = "Capsule" )
type UserGroupList ¶
func NewUserGroupList ¶
func NewUserGroupList(groups []string) UserGroupList
Click to show internal directories.
Click to hide internal directories.