openshift

package
v0.0.0-...-4e66905 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

README

Note this package is here until the oc go client is separated from the openshift code base. This is due in 3.7 of OSCP. It is worth waiting to avoid having to vendor most of the Openshift and kubernetes code base. But will be removed once 3.7 lands

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthenticationError

func IsAuthenticationError(err error) bool

func NewAuthCheckerBuilder

func NewAuthCheckerBuilder(host string) mobile.AuthCheckerBuilder

NewAuthCheckerBuilder created and returned with the provided namespace and host

func NewClientBuilder

func NewClientBuilder(host, ns string, incluster, insecure bool) mobile.OSClientBuilder

func NewUserRepoBuilder

func NewUserRepoBuilder(host string, ignoreCerts bool) mobile.UserRepoBuilder

Types

type AuthChecker

type AuthChecker struct {
	Host          string
	Token         string
	SkipCertCheck bool
	UserRepo      mobile.UserRepo
}

AuthChecker checks authorizations against resource in namespaces

func (*AuthChecker) Check

func (ac *AuthChecker) Check(resource, namespace string, client mobile.ExternalHTTPRequester) (bool, error)

Check that the resource in the provided namespace can be written to by the current user

type AuthCheckerBuilder

type AuthCheckerBuilder struct {
	Host          string
	Token         string
	SkipCertCheck bool
	UserRepo      mobile.UserRepo
}

AuthCheckerBuilder for building AuthCheckers

func (*AuthCheckerBuilder) Build

func (acb *AuthCheckerBuilder) Build() mobile.AuthChecker

Build an AuthChecker and return it

func (*AuthCheckerBuilder) IgnoreCerts

func (acb *AuthCheckerBuilder) IgnoreCerts() mobile.AuthCheckerBuilder

IgnoreCerts sets the config to ignore future certificate errors

func (*AuthCheckerBuilder) WithToken

func (acb *AuthCheckerBuilder) WithToken(token string) mobile.AuthCheckerBuilder

WithToken stores the provided for creating future AuthCheckers

func (*AuthCheckerBuilder) WithUserRepo

WithUserRepo stores the provided userrrepo for creating future AuthCheckers

type AuthenticationError

type AuthenticationError struct {
	Message    string
	StatusCode int
}

func (*AuthenticationError) Code

func (ae *AuthenticationError) Code() int

func (*AuthenticationError) Error

func (ae *AuthenticationError) Error() string

type ClientBuilder

type ClientBuilder struct {
	// contains filtered or unexported fields
}

ClientBuilder is a utility to help in the construction of OpenShift clients

func (*ClientBuilder) BuildClient

func (cb *ClientBuilder) BuildClient() (client.Interface, error)

func (*ClientBuilder) WithHost

func (cb *ClientBuilder) WithHost(host string) mobile.OSClientBuilder

func (*ClientBuilder) WithHostAndNamespace

func (cb *ClientBuilder) WithHostAndNamespace(host, ns string) mobile.OSClientBuilder

func (*ClientBuilder) WithNamespace

func (cb *ClientBuilder) WithNamespace(ns string) mobile.OSClientBuilder

func (*ClientBuilder) WithToken

func (cb *ClientBuilder) WithToken(token string) mobile.OSClientBuilder

type UserAccess

type UserAccess struct{}

func (*UserAccess) ReadUserFromToken

func (ua *UserAccess) ReadUserFromToken(host, token string, insecure bool) (*mobile.User, error)

type UserChecker

type UserChecker func(host, token string, skipTLS bool) (*mobile.User, error)

type UserRepo

type UserRepo struct {
	// contains filtered or unexported fields
}

func (*UserRepo) GetUser

func (ur *UserRepo) GetUser() (*mobile.User, error)

type UserRepoBuilder

type UserRepoBuilder struct {
	// contains filtered or unexported fields
}

func (*UserRepoBuilder) Build

func (urb *UserRepoBuilder) Build() mobile.UserRepo

func (*UserRepoBuilder) WithClient

func (*UserRepoBuilder) WithToken

func (urb *UserRepoBuilder) WithToken(token string) mobile.UserRepoBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL