oauth

package
v0.1.73 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OAuthServerPort   = 6443
	RouteExternalPort = 443
)
View Source
const (
	IDPVolumePathPrefix = "/etc/oauth/idp"
)
View Source
const (
	KubeadminSecretHashAnnotation = "hypershift.openshift.io/kubeadmin-secret-hash"
)

Variables

This section is empty.

Functions

func ReconcileExternalPrivateRoute added in v0.1.2

func ReconcileExternalPrivateRoute(route *routev1.Route, ownerRef config.OwnerRef, hostname string, defaultIngressDomain string, labelHCPRoutes bool) error

func ReconcileExternalPublicRoute added in v0.1.2

func ReconcileExternalPublicRoute(route *routev1.Route, ownerRef config.OwnerRef, hostname string, defaultIngressDomain string, labelHCPRoutes bool) error

func ReconcileInternalRoute

func ReconcileInternalRoute(route *routev1.Route, ownerRef config.OwnerRef) error

func ReconcileService

func ReconcileService(svc *corev1.Service, ownerRef config.OwnerRef, strategy *hyperv1.ServicePublishingStrategy, platformType hyperv1.PlatformType) error

func ReconcileServiceStatus

func ReconcileServiceStatus(svc *corev1.Service, route *routev1.Route, strategy *hyperv1.ServicePublishingStrategy) (host string, port int32, message string, err error)

Types

type ConfigOverride

type ConfigOverride struct {
	URLs      osinv1.OpenIDURLs   `json:"urls,omitempty"`
	Claims    osinv1.OpenIDClaims `json:"claims,omitempty"`
	Challenge *bool               `json:"challenge,omitempty"`
}

ConfigOverride defines the oauth parameters that can be overridden in special use cases. The only supported use case for this currently is the IBMCloud IAM OIDC provider. These parameters are necessary since the public OpenID api does not support some customizations used in the IBMCloud IAM OIDC provider. This can be removed if the public API is adjusted to allow specifying these customizations.

type IDPVolumeMountInfo

type IDPVolumeMountInfo struct {
	Container    string
	VolumeMounts util.PodVolumeMounts
	Volumes      []corev1.Volume
}

func ConvertIdentityProviders added in v0.1.50

func ConvertIdentityProviders(ctx context.Context, identityProviders []configv1.IdentityProvider, providerOverrides map[string]*ConfigOverride, kclient crclient.Client, namespace string) ([]osinv1.IdentityProvider, *IDPVolumeMountInfo, error)

func (*IDPVolumeMountInfo) ConfigMapPath

func (i *IDPVolumeMountInfo) ConfigMapPath(index int, configMapName, field, key string) string

func (*IDPVolumeMountInfo) SecretPath

func (i *IDPVolumeMountInfo) SecretPath(index int, secretName, field, key string) string

type OAuthServerParams

type OAuthServerParams struct {
	OwnerRef         config.OwnerRef `json:"ownerRef"`
	ExternalHost     string          `json:"externalHost"`
	ExternalPort     int32           `json:"externalPort"`
	ExternalAPIHost  string          `json:"externalAPIHost"`
	ExternalAPIPort  int32           `json:"externalAPIPort"`
	OAuthServerImage string
	OAuth            *configv1.OAuthSpec
	ProxyConfig      *configv1.ProxySpec
	APIServer        *configv1.APIServerSpec `json:"apiServer"`
	// OauthConfigOverrides contains a mapping from provider name to the config overrides specified for the provider.
	// The only supported use case of using this is for the IBMCloud IAM OIDC provider.
	OauthConfigOverrides map[string]*ConfigOverride
	// LoginURLOverride can be used to specify an override for the oauth config login url. The need for this arises
	// when the login a provider uses doesn't conform to the standard login url in hypershift. The only supported use case
	// for this is IBMCloud Red Hat Openshift
	LoginURLOverride        string
	AvailabilityProberImage string `json:"availabilityProberImage"`
	Availability            hyperv1.AvailabilityPolicy
	// ProxyImage is the image that contains the control-plane-operator binary that will
	// be used to run konnectivity-socks5-proxy and konnectivity-https-proxy
	ProxyImage string
	// OAuthNoProxy is a list of hosts or IPs that should not be routed through
	// konnectivity. Currently only used for IBM Cloud specific addresses.
	OAuthNoProxy    []string
	AuditWebhookRef *corev1.LocalObjectReference
}

func NewOAuthServerParams

func NewOAuthServerParams(hcp *hyperv1.HostedControlPlane, releaseImageProvider imageprovider.ReleaseImageProvider, host string, port int32, setDefaultSecurityContext bool) *OAuthServerParams

func (*OAuthServerParams) IdentityProviders

func (p *OAuthServerParams) IdentityProviders() []configv1.IdentityProvider

type OAuthServiceParams

type OAuthServiceParams struct {
	OAuth    *configv1.OAuth `json:"oauth"`
	OwnerRef config.OwnerRef `json:"ownerRef"`
}

func NewOAuthServiceParams

func NewOAuthServiceParams(hcp *hyperv1.HostedControlPlane) *OAuthServiceParams

Jump to

Keyboard shortcuts

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