config

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonCliArgs added in v0.7.3

type CommonCliArgs struct {
	MetricsAddr string `arg:"--metrics-bind-address, env" default:"127.0.0.1:8080" help:"The address the metric endpoint binds to."`
	ProbeAddr   string `arg:"--health-probe-bind-address, env" default:":8081" help:"The address the probe endpoint binds to."`
	ConfigFile  string `arg:"--config-file, env" default:"/etc/spi/config.yaml" help:"The location of the configuration file."`
	BaseUrl     string `` /* 154-byte string literal not displayed */
}

CommonCliArgs are the command line arguments and environment variable definitions understood by the configuration infrastructure shared between the operator and the oauth service.

type LoggingCliArgs added in v0.7.3

type LoggingCliArgs struct {
	ZapDevel           bool   `` /* 213-byte string literal not displayed */
	ZapEncoder         string `arg:"--zap-encoder, env" default:"" help:"Zap log encoding (‘json’ or ‘console’)"`
	ZapLogLevel        string `arg:"--zap-log-level, env" default:"" help:"Zap Level to configure the verbosity of logging"`
	ZapStackTraceLevel string `arg:"--zap-stacktrace-level, env" default:"" help:"Zap Level at and above which stacktraces are captured"`
	ZapTimeEncoding    string `` /* 127-byte string literal not displayed */
}

LoggingCliArgs define the command line arguments for configuring the logging using Zap.

type ServiceProviderConfiguration

type ServiceProviderConfiguration struct {
	// ClientId is the client ID of the OAuth application that the SPI uses to access the service provider.
	ClientId string `yaml:"clientId"`

	// ClientSecret is the client secret of the OAuth application that the SPI uses to access the service provider.
	ClientSecret string `yaml:"clientSecret"`

	// ServiceProviderType is the type of the service provider. This must be one of the supported values: GitHub, Quay
	ServiceProviderType ServiceProviderType `yaml:"type"`

	// ServiceProviderBaseUrl is the base URL of the service provider. This can be omitted for certain service provider
	// types, like GitHub that only can have 1 well-known base URL.
	ServiceProviderBaseUrl string `yaml:"baseUrl,omitempty"`

	// Extra is the extra configuration required for some service providers to be able to uniquely identify them. E.g.
	// for Quay, we require to know the organization for which the OAuth application is defined for.
	Extra map[string]string `yaml:"extra,omitempty"`
}

ServiceProviderConfiguration contains configuration for a single service provider configured with the SPI. This mainly contains config.yaml of the OAuth application within the service provider.

type ServiceProviderType

type ServiceProviderType string
const (
	ServiceProviderTypeGitHub          ServiceProviderType = "GitHub"
	ServiceProviderTypeQuay            ServiceProviderType = "Quay"
	ServiceProviderTypeGitLab          ServiceProviderType = "GitLab"
	ServiceProviderTypeHostCredentials ServiceProviderType = "HostCredentials"

	MetricsNamespace = "redhat_appstudio"
	MetricsSubsystem = "spi"
)

type SharedConfiguration added in v0.7.3

type SharedConfiguration struct {
	// ServiceProviders is the list of configuration options for the individual service providers
	ServiceProviders []ServiceProviderConfiguration

	// BaseUrl is the URL on which the OAuth service is deployed. It is used to compose the redirect URLs for the
	// service providers in the form of `${BASE_URL}/oauth/callback` (e.g. my-host/oauth/callback).
	BaseUrl string
}

SharedConfiguration contains the specification of the known service providers as well as other configuration data shared between the SPI OAuth service and the SPI operator

func LoadFrom

func LoadFrom(args *CommonCliArgs) (SharedConfiguration, error)

Jump to

Keyboard shortcuts

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