Documentation
¶
Index ¶
Constants ¶
const APIServerName = "cluster"
APIServerName is the apiserver resource name used to fetch it.
Variables ¶
var ErrGetInvalidProfile = errors.New("got invalid TLS profile from cluster, using default TLS profile")
ErrGetInvalidProfile happens when the profile is invalid or unknow.
var ErrGetProfileFromCluster = errors.New("failed to get profile from cluster, using default TLS profile")
ErrGetProfileFromCluster happens when failed to get the cluster security policy in openshift.
var ErrInvalidTLSVersion = errors.New("invalid TLS version")
ErrInvalidTLSVersion is returned when the TLS version is invalid.
Functions ¶
func GetDefaultTLSSecurityProfile ¶
func GetDefaultTLSSecurityProfile() openshiftconfigv1.TLSSecurityProfile
GetDefaultTLSSecurityProfile get the default tls profile settings if none is specified.
Types ¶
type TLSProfileOptions ¶
type TLSProfileOptions struct { // Ciphers is used to specify the cipher algorithms that are negotiated // during the TLS handshake. Ciphers []string // MinTLSVersion is used to specify the minimal version of the TLS protocol // that is negotiated during the TLS handshake. MinTLSVersion string }
TLSProfileOptions is the desired behavior of a TLSProfileType.
func Get ¶
func Get(ctx context.Context, fg configv1alpha1.FeatureGates, c k8getter) (TLSProfileOptions, error)
Get the profile according to the features configuration, if the policy is invalid or is not specified (empty string) this should return an error, if openshift.ClusterTLSPolicy is enabled, it should get the profile from the cluster, if the cluster return a unknow profile this should return an error.
func GetTLSSettings ¶
func GetTLSSettings(profile openshiftconfigv1.TLSSecurityProfile) (TLSProfileOptions, error)
GetTLSSettings get the tls settings that belongs to the TLS profile specifications.
func (TLSProfileOptions) MinVersionShort ¶
func (o TLSProfileOptions) MinVersionShort() (string, error)
MinVersionShort returns the min TLS version but only the number instead of VersionTLS10 it will return 1.0.
func (TLSProfileOptions) TLSCipherSuites ¶
func (o TLSProfileOptions) TLSCipherSuites() string
TLSCipherSuites transforms TLSProfileSpec.Ciphers from a slice to a string of elements joined with a comma.