Documentation ¶
Overview ¶
Package tlsutils contains the utility functions related to tls communication of the adapter
Package common includes the common functions shared between enforcer and router callbacks.
Index ¶
- func AddClientConnection(clientID string, stream apkmgt.EventStreamService_StreamEventsServer)
- func DeleteClientConnection(clientID string)
- func FilterAIRatelimitPolicyByNamespaces(namespaces []string) func(object *dpv1alpha3.AIRateLimitPolicy) bool
- func FilterAPIByNamespaces(namespaces []string) func(object *dpv1alpha3.API) bool
- func FilterAppByNamespaces(namespaces []string) func(object *cpv1alpha2.Application) bool
- func FilterAppMappingByNamespaces(namespaces []string) func(object *cpv1alpha2.ApplicationMapping) bool
- func FilterHTTPRouteByNamespaces(namespaces []string) func(object *gwapiv1.HTTPRoute) bool
- func FilterRateLimitPolicyByNamespaces(namespaces []string) func(object *dpv1alpha3.RateLimitPolicy) bool
- func FilterSubsByNamespaces(namespaces []string) func(object *cpv1alpha3.Subscription) bool
- func GetAllClientConnections() map[string]apkmgt.EventStreamService_StreamEventsServer
- func GetEnvironment(environment string) string
- func GetKeyLocations() (string, string, string)
- func GetNodeIdentifier(request *discovery.DiscoveryRequest) string
- func GetOperatorPodNamespace() string
- func GetServerCertificate(tlsCertificate string, tlsCertificateKey string) (tls.Certificate, error)
- func GetTrustedCertPool(truststoreLocation string) *x509.CertPool
- func InvokeControlPlane(req *http.Request, skipSSL bool) (*http.Response, error)
- func IsPublicCertificate(certContent []byte) bool
- func NamespacedName(obj k8client.Object) types.NamespacedName
- func SendAddApplicationEvent(application cpv1alpha2.Application)
- func SendAddSubscriptionEvent(sub cpv1alpha3.Subscription)
- func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec)
- func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.ApplicationSpec, ...)
- func SendApplicationEvent(...)
- func SendApplicationKeyMappingEvent(...)
- func SendApplicationMappingEvent(eventType, id, applicationRef, subscriptionRef, organization string)
- func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.ApplicationMapping, ...)
- func SendDeleteApplicationMappingEvent(applicationMappingUUID string, ...)
- func SendDeleteSubscriptionEvent(subscriptionUUID string, sub cpv1alpha3.Subscription)
- func SendResetEvent()
- func SendSubscriptionEvent(...)
- type NodeQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddClientConnection ¶
func AddClientConnection(clientID string, stream apkmgt.EventStreamService_StreamEventsServer)
AddClientConnection adds a client connection to the map
func DeleteClientConnection ¶
func DeleteClientConnection(clientID string)
DeleteClientConnection deletes a client connection from the map
func FilterAIRatelimitPolicyByNamespaces ¶
func FilterAIRatelimitPolicyByNamespaces(namespaces []string) func(object *dpv1alpha3.AIRateLimitPolicy) bool
FilterAIRatelimitPolicyByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterAPIByNamespaces ¶
func FilterAPIByNamespaces(namespaces []string) func(object *dpv1alpha3.API) bool
FilterAPIByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterAppByNamespaces ¶
func FilterAppByNamespaces(namespaces []string) func(object *cpv1alpha2.Application) bool
FilterAppByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterAppMappingByNamespaces ¶
func FilterAppMappingByNamespaces(namespaces []string) func(object *cpv1alpha2.ApplicationMapping) bool
FilterAppMappingByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterHTTPRouteByNamespaces ¶
FilterHTTPRouteByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterRateLimitPolicyByNamespaces ¶
func FilterRateLimitPolicyByNamespaces(namespaces []string) func(object *dpv1alpha3.RateLimitPolicy) bool
FilterRateLimitPolicyByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func FilterSubsByNamespaces ¶
func FilterSubsByNamespaces(namespaces []string) func(object *cpv1alpha3.Subscription) bool
FilterSubsByNamespaces takes a list of namespaces and returns a filter function which return true if the input object is in the given namespaces list, and returns false otherwise
func GetAllClientConnections ¶
func GetAllClientConnections() map[string]apkmgt.EventStreamService_StreamEventsServer
GetAllClientConnections returns all client connections
func GetEnvironment ¶
GetEnvironment takes the environment of the API. If the value is empty, it will return the default environment that is set in the config of the common controller.
func GetKeyLocations ¶
GetKeyLocations function returns the public key path and private key path
func GetNodeIdentifier ¶
func GetNodeIdentifier(request *discovery.DiscoveryRequest) string
GetNodeIdentifier constructs the nodeIdentifier from discovery request's node property, label:<instanceIdentifierProperty>
func GetOperatorPodNamespace ¶
func GetOperatorPodNamespace() string
GetOperatorPodNamespace returns the namesapce of the operator pod
func GetServerCertificate ¶
func GetServerCertificate(tlsCertificate string, tlsCertificateKey string) (tls.Certificate, error)
GetServerCertificate returns the certificate (used for the restAPI server and xds server) created based on configuration values. Move to pkg. remove config and read from a file path
func GetTrustedCertPool ¶
GetTrustedCertPool returns the trusted certificate (used for the restAPI server and xds server) created based on the provided directory/file path. Move to pkg
func InvokeControlPlane ¶
InvokeControlPlane sends request to the control plane and returns the response
func IsPublicCertificate ¶
IsPublicCertificate checks if the file content represents valid public certificate in PEM format. Move to pkg
func NamespacedName ¶
func NamespacedName(obj k8client.Object) types.NamespacedName
NamespacedName generates namespaced name for Kubernetes objects
func SendAddApplicationEvent ¶
func SendAddApplicationEvent(application cpv1alpha2.Application)
SendAddApplicationEvent sends an application creation event to the enforcer
func SendAddSubscriptionEvent ¶
func SendAddSubscriptionEvent(sub cpv1alpha3.Subscription)
SendAddSubscriptionEvent sends an subscription creation event to the enforcer
func SendAppDeletionEvent ¶
func SendAppDeletionEvent(applicationUUID string, applicationSpec cpv1alpha2.ApplicationSpec)
SendAppDeletionEvent sends an application creation event to the enforcer
func SendAppUpdateEvent ¶
func SendAppUpdateEvent(applicationUUID string, oldApplicationSpec cpv1alpha2.ApplicationSpec, newApplicationSpec cpv1alpha2.ApplicationSpec)
SendAppUpdateEvent sends an application update event to the enforcer
func SendApplicationEvent ¶
func SendApplicationEvent(eventType, applicationUUID, applicationName, applicationOwner, organization string, appAttribute map[string]string)
SendApplicationEvent sends an application deletion event to the enforcer
func SendApplicationKeyMappingEvent ¶
func SendApplicationKeyMappingEvent(eventType, applicationUUID, securityScheme, applicationIdentifier, keyType, envID, organization string)
SendApplicationKeyMappingEvent sends an application key mapping event to the enforcer
func SendApplicationMappingEvent ¶
func SendApplicationMappingEvent(eventType, id, applicationRef, subscriptionRef, organization string)
SendApplicationMappingEvent sends an application mapping event to the enforcer
func SendCreateApplicationMappingEvent ¶
func SendCreateApplicationMappingEvent(applicationMapping cpv1alpha2.ApplicationMapping, application cpv1alpha2.Application, subscriptionCr cpv1alpha3.Subscription)
SendCreateApplicationMappingEvent sends an application mapping event to the enforcer
func SendDeleteApplicationMappingEvent ¶
func SendDeleteApplicationMappingEvent(applicationMappingUUID string, applicationMappingSpec cpv1alpha2.ApplicationMappingSpec, organization string)
SendDeleteApplicationMappingEvent sends an application mapping deletion event to the enforcer
func SendDeleteSubscriptionEvent ¶
func SendDeleteSubscriptionEvent(subscriptionUUID string, sub cpv1alpha3.Subscription)
SendDeleteSubscriptionEvent sends an subscription deletion event to the enforcer
func SendSubscriptionEvent ¶
func SendSubscriptionEvent(eventType, subscriptionID, subscriptionStatus, organization, apiName, apiVersion string, ratelimit string)
SendSubscriptionEvent sends an subscription creation event to the enforcer
Types ¶
type NodeQueue ¶
type NodeQueue struct {
// contains filtered or unexported fields
}
NodeQueue struct is used to keep track of the nodes connected via the XDS.
func GenerateNodeQueue ¶
func GenerateNodeQueue() *NodeQueue
GenerateNodeQueue creates an instance of nodeQueue with a mutex and a string array assigned.