Documentation
¶
Index ¶
- Constants
- Variables
- func AuthEnabled() bool
- func MatchGRPCError(code interface{}, err interface{}) types.GomegaMatcher
- func NewApplicationsServer(cfg *ApplicationsConfig, setters ...ApplicationsOption) pb.ApplicationsServer
- func NewDefaultFetcherFactory() applicationv2.FetcherFactory
- func NewHandlers(ctx context.Context, cfg *Config) (http.Handler, error)
- func NewProfilesServer(config ProfilesConfig) pb.ProfilesServer
- type ApplicationsConfig
- type ApplicationsOption
- type ApplicationsOptions
- type Config
- type DefaultFetcherFactory
- type ImpersonatingConfigGetter
- type ProfilesConfig
- type ProfilesServer
Constants ¶
const ( OctetStreamType = "application/octet-stream" JsonType = "application/json" )
const (
AuthEnabledFeatureFlag = "WEAVE_GITOPS_AUTH_ENABLED"
)
const DefaultHost = "0.0.0.0"
const DefaultPort = "9001"
Variables ¶
var ( ErrEmptyAccessToken = errors.New("access token is empty") ErrBadProvider = errors.New("wrong provider name") )
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
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 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
func (f *DefaultFetcherFactory) Create(client client.Client) applicationv2.Fetcher
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.
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
func (s *ProfilesServer) GetProfiles(ctx context.Context, msg *pb.GetProfilesRequest) (*pb.GetProfilesResponse, error)