1 package v1 2 3 import ( 4 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 ) 6 7 // +genclient 8 // +genclient:nonNamespaced 9 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 11 // Console holds cluster-wide configuration for the web console, including the 12 // logout URL, and reports the public URL of the console. The canonical name is 13 // `cluster`. 14 // 15 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 16 // +openshift:compatibility-gen:level=1 17 type Console struct { 18 metav1.TypeMeta `json:",inline"` 19 20 // metadata is the standard object's metadata. 21 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 22 metav1.ObjectMeta `json:"metadata,omitempty"` 23 24 // spec holds user settable values for configuration 25 // +kubebuilder:validation:Required 26 // +required 27 Spec ConsoleSpec `json:"spec"` 28 // status holds observed values from the cluster. They may not be overridden. 29 // +optional 30 Status ConsoleStatus `json:"status"` 31 } 32 33 // ConsoleSpec is the specification of the desired behavior of the Console. 34 type ConsoleSpec struct { 35 // +optional 36 Authentication ConsoleAuthentication `json:"authentication"` 37 } 38 39 // ConsoleStatus defines the observed status of the Console. 40 type ConsoleStatus struct { 41 // The URL for the console. This will be derived from the host for the route that 42 // is created for the console. 43 ConsoleURL string `json:"consoleURL"` 44 } 45 46 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 47 48 // Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 49 // +openshift:compatibility-gen:level=1 50 type ConsoleList struct { 51 metav1.TypeMeta `json:",inline"` 52 53 // metadata is the standard list's metadata. 54 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 55 metav1.ListMeta `json:"metadata"` 56 57 Items []Console `json:"items"` 58 } 59 60 // ConsoleAuthentication defines a list of optional configuration for console authentication. 61 type ConsoleAuthentication struct { 62 // An optional, absolute URL to redirect web browsers to after logging out of 63 // the console. If not specified, it will redirect to the default login page. 64 // This is required when using an identity provider that supports single 65 // sign-on (SSO) such as: 66 // - OpenID (Keycloak, Azure) 67 // - RequestHeader (GSSAPI, SSPI, SAML) 68 // - OAuth (GitHub, GitLab, Google) 69 // Logging out of the console will destroy the user's token. The logoutRedirect 70 // provides the user the option to perform single logout (SLO) through the identity 71 // provider to destroy their single sign-on session. 72 // +optional 73 // +kubebuilder:validation:Pattern=`^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$` 74 LogoutRedirect string `json:"logoutRedirect,omitempty"` 75 } 76