validation

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNameValidity

type AppNameValidity struct {
	// True when the application name is valid.
	Valid bool `json:"valid"`
}

AppNameValidity describes validity of the application name.

func ValidateAppName

func ValidateAppName(spec *AppNameValiditySpec, client client.Interface) (*AppNameValidity, error)

ValidateAppName validates application name. When error is returned, name validity could not be determined.

type AppNameValiditySpec

type AppNameValiditySpec struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

AppNameValiditySpec is a specification for application name validation request.

type ImageReferenceValidity

type ImageReferenceValidity struct {
	// True when the image reference is valid.
	Valid bool `json:"valid"`
	// Error reason when image reference is valid
	Reason string `json:"reason"`
}

ImageReferenceValidity describes validity of the image reference.

func ValidateImageReference

func ValidateImageReference(spec *ImageReferenceValiditySpec) (*ImageReferenceValidity, error)

ValidateImageReference validates image reference.

type ImageReferenceValiditySpec

type ImageReferenceValiditySpec struct {
	// Reference of the image
	Reference string `json:"reference"`
}

ImageReferenceValiditySpec is a specification of an image reference validation request.

type LoginStatus

type LoginStatus struct {
	// True when token header indicating logged in user is found in request.
	TokenPresent bool `json:"tokenPresent"`
	// True when authorization header indicating logged in user is found in request.
	HeaderPresent bool `json:"headerPresent"`
	// True if dashboard is configured to use HTTPS connection. It is required for secure
	// data exchange during login operation.
	HTTPSMode bool `json:"httpsMode"`
	// True if impersonation is enabled
	ImpersonationPresent bool `json:"impersonationPresent"`

	// The impersonated user
	ImpersonatedUser string `json:"impersonatedUser"`
}

LoginStatus is returned as a response to login status check. Used by the frontend to determine if is logged in and if login page should be shown.

func ValidateLoginStatus

func ValidateLoginStatus(request *restful.Request) *LoginStatus

ValidateLoginStatus returns information about user login status and if request was made over HTTPS.

type ProtocolValidity

type ProtocolValidity struct {
	// True when the selected protocol is valid for selected service type.
	Valid bool `json:"valid"`
}

ProtocolValidity describes validity of the protocol.

func ValidateProtocol

func ValidateProtocol(spec *ProtocolValiditySpec) *ProtocolValidity

ValidateProtocol validates protocol based on whether created service is set to NodePort or NodeBalancer type.

type ProtocolValiditySpec

type ProtocolValiditySpec struct {
	// Protocol type
	Protocol api.Protocol `json:"protocol"`

	// Service type. LoadBalancer(true)/NodePort(false).
	IsExternal bool `json:"isExternal"`
}

ProtocolValiditySpec is a specification of protocol validation request.

type RbacStatus

type RbacStatus struct {
	// True when RBAC is enabled in the cluster.
	Enabled bool `json:"enabled"`
}

RbacStatus describes status of RBAC in the cluster.

func ValidateRbacStatus

func ValidateRbacStatus(client kubernetes.Interface) (*RbacStatus, error)

ValidateRbacStatus validates if RBAC is enabled in the cluster. Supported version of RBAC api is: 'rbac.authorization.k8s.io/v1beta1'

Jump to

Keyboard shortcuts

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