server

package
v0.6.2-patch2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MPL-2.0 Imports: 56 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OctetStreamType = "application/octet-stream"
	JsonType        = "application/json"
)
View Source
const (
	AuthEnabledFeatureFlag = "WEAVE_GITOPS_AUTH_ENABLED"
)
View Source
const DefaultHost = "0.0.0.0"
View Source
const DefaultPort = "9001"

Variables

View Source
var (
	ErrEmptyAccessToken = errors.New("access token is empty")
	ErrBadProvider      = errors.New("wrong provider name")
)
View Source
var (
	KustomizeNameKey      = fmt.Sprintf("%s/name", kustomizev2.GroupVersion.Group)
	KustomizeNamespaceKey = fmt.Sprintf("%s/namespace", kustomizev2.GroupVersion.Group)
	HelmNameKey           = fmt.Sprintf("%s/name", helmv2.GroupVersion.Group)
	HelmNamespaceKey      = fmt.Sprintf("%s/namespace", helmv2.GroupVersion.Group)
)

Flux owner labels

View Source
var (
	PublicRoutes = []string{
		"/v1/featureflags",
	}
)

Functions

func AuthEnabled added in v0.6.1

func AuthEnabled() bool

func MatchGRPCError added in v0.2.5

func MatchGRPCError(code interface{}, err interface{}) types.GomegaMatcher

func NewApplicationsServer

func NewApplicationsServer(cfg *ApplicationsConfig, setters ...ApplicationsOption) pb.ApplicationsServer

NewApplicationsServer creates a grpc Applications server

func NewDefaultFetcherFactory added in v0.6.1

func NewDefaultFetcherFactory() applicationv2.FetcherFactory

NewDefaultFetcherFactory returns a new DefaultFetcherFactory

func NewHandlers added in v0.6.0

func NewHandlers(ctx context.Context, cfg *Config) (http.Handler, error)

func NewProfilesServer added in v0.6.0

func NewProfilesServer(config ProfilesConfig) pb.ProfilesServer

Types

type ApplicationsConfig added in v0.2.3

type ApplicationsConfig struct {
	Logger           logr.Logger
	Factory          services.Factory
	JwtClient        auth.JWTClient
	GithubAuthClient auth.GithubAuthClient
	FetcherFactory   applicationv2.FetcherFactory
	GitlabAuthClient auth.GitlabAuthClient
	ClusterConfig    kube.ClusterConfig
}

An ApplicationsConfig allows for the customization of an ApplicationsServer. Use the DefaultConfig() to use the default dependencies.

func DefaultApplicationsConfig added in v0.6.0

func DefaultApplicationsConfig() (*ApplicationsConfig, error)

DefaultApplicationsConfig creates a populated config with the dependencies for a Server

type ApplicationsOption added in v0.6.1

type ApplicationsOption func(*ApplicationsOptions)

ApplicationsOption defines the signature of a function that can be used to set an option for an ApplicationsServer.

func WithClientGetter added in v0.6.1

func WithClientGetter(clientGetter kube.ClientGetter) ApplicationsOption

WithClientGetter allows for setting a ClientGetter.

func WithKubeGetter added in v0.7.0

func WithKubeGetter(kubeGetter kube.KubeGetter) ApplicationsOption

WithKubeGetter allows for setting a KubeGetter.

type ApplicationsOptions added in v0.6.1

type ApplicationsOptions struct {
	ClientGetter kube.ClientGetter
	KubeGetter   kube.KubeGetter
}

ApplicationsOptions includes all the options that can be set for an ApplicationsServer.

type Config added in v0.6.0

type Config struct {
	AppConfig      *ApplicationsConfig
	AppOptions     []ApplicationsOption
	ProfilesConfig ProfilesConfig
	AuthServer     *auth.AuthServer
}

type DefaultFetcherFactory added in v0.6.1

type DefaultFetcherFactory struct {
}

DefaultFetcherFactory creates applicationv2.Fetcher objects from a Kubernetes client

func (*DefaultFetcherFactory) Create added in v0.6.1

Create uses a Kubernetes client to create an applicationv2.Fetcher object.

type ImpersonatingConfigGetter added in v0.6.1

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

ImpersonatingConfigGetter is an implementation of the ConfigGetter interface that returns configs based on a base one. It inspects the context for a principal and if it finds one, it configures the *rest.Config to impersonate that principal. Otherwise it returns a copy of the base config.

func NewImpersonatingConfigGetter added in v0.6.1

func NewImpersonatingConfigGetter(cfg *rest.Config, insecure bool) *ImpersonatingConfigGetter

NewImpersonatingConfigGetter creates and returns a ConfigGetter with a known config.

func (*ImpersonatingConfigGetter) Config added in v0.6.1

Config returns a *rest.Config configured to impersonate a user or use the default service account credentials.

type ProfilesConfig added in v0.6.0

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

func NewProfilesConfig added in v0.6.0

func NewProfilesConfig(clusterConfig kube.ClusterConfig, helmCache cache.Cache, helmRepoNamespace, helmRepoName string) ProfilesConfig

type ProfilesServer added in v0.6.0

type ProfilesServer struct {
	pb.UnimplementedProfilesServer

	Log               logr.Logger
	HelmRepoName      string
	HelmRepoNamespace string
	HelmCache         cache.Cache
	ClientGetter      kube.ClientGetter
}

func (*ProfilesServer) GetProfileValues added in v0.6.0

func (s *ProfilesServer) GetProfileValues(ctx context.Context, msg *pb.GetProfileValuesRequest) (*httpbody.HttpBody, error)

func (*ProfilesServer) GetProfiles added in v0.6.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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