Documentation ¶
Index ¶
- type DefaultOpenShiftClient
- func (c *DefaultOpenShiftClient) ListNamespaces(token string) (namespaces []Namespace, err error)
- func (c *DefaultOpenShiftClient) SubjectAccessReview(groups []string, user, namespace, verb, resource, resourceAPIGroup string) (bool, error)
- func (c *DefaultOpenShiftClient) TokenReview(token string) (*TokenReview, error)
- type Namespace
- type OpenShiftClient
- type TokenReview
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultOpenShiftClient ¶
type DefaultOpenShiftClient struct {
// contains filtered or unexported fields
}
DefaultOpenShiftClient is the default impl of OpenShiftClient
func (*DefaultOpenShiftClient) ListNamespaces ¶
func (c *DefaultOpenShiftClient) ListNamespaces(token string) (namespaces []Namespace, err error)
ListNamespaces associated with a given token
func (*DefaultOpenShiftClient) SubjectAccessReview ¶
func (c *DefaultOpenShiftClient) SubjectAccessReview(groups []string, user, namespace, verb, resource, resourceAPIGroup string) (bool, error)
SubjectAccessReview performs a SAR and returns true if the user is allowed
func (*DefaultOpenShiftClient) TokenReview ¶
func (c *DefaultOpenShiftClient) TokenReview(token string) (*TokenReview, error)
TokenReview performs a tokenreview for a given token submitting to the apiserver using the serviceaccount token. It returns a simplejson object of the response
type Namespace ¶
type Namespace struct {
Ns osprojectv1.Project
}
Namespace wrappers a core kube namespace type
type OpenShiftClient ¶
type OpenShiftClient interface { ListNamespaces(token string) ([]Namespace, error) //TokenReview performs a tokenreview for a given token submitting to the apiserver //using the serviceaccount token. It returns a simplejson object of the response TokenReview(token string) (*TokenReview, error) SubjectAccessReview(groups []string, user, namespace, verb, resource, resourceAPIGroup string) (bool, error) }
OpenShiftClient abstracts kubeclient and calls
func NewOpenShiftClient ¶
func NewOpenShiftClient() (OpenShiftClient, error)
NewOpenShiftClient returns a client for connecting to the api server.
type TokenReview ¶
type TokenReview struct {
*authenticationapi.TokenReview
}
TokenReview is simple struct wrapper around a kubernetes TokenReview
func (*TokenReview) Groups ¶
func (t *TokenReview) Groups() []string
Groups returns the groups associated with a given token
func (*TokenReview) UserName ¶
func (t *TokenReview) UserName() string
UserName returns the username associated with a given token