namespaces

package
v0.0.76 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package namespaces contains logic relating to the namespacing of Rule Types and Profiles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoesSubscriptionIDMatch

func DoesSubscriptionIDMatch(subscriptionID uuid.UUID, dbSubscriptionID uuid.NullUUID) error

DoesSubscriptionIDMatch takes a subscription ID from the database, and compares it with the subscriptionID parameter. It asserts that: A) If the subscription ID from the DB is not null, that it is equal to subscription ID. B) If the subscription ID from the DB is null, the subscriptionID parameter must be equal to uuid.Nil This logic is intended to check if the subscription ID associated with a rule type or profile matches a given subscription ID.

func ValidateLabelsPresence

func ValidateLabelsPresence(labels []string, subscriptionID uuid.UUID) error

ValidateLabelsPresence makes sure that only profiles that belong to a subscription bundle have labels

func ValidateLabelsUpdate

func ValidateLabelsUpdate(labels, dbLabels []string) error

ValidateLabelsUpdate ensures that labels cannot be updated

func ValidateNamespacedNameRules

func ValidateNamespacedNameRules(name string, subscriptionID uuid.UUID) error

ValidateNamespacedNameRules takes a name for a new profile or rule type and asserts that: A) If the subscriptionID is empty, there name should not be namespaced B) If subscriptionID is not empty, the name must be namespaced This assumes the name has already been validated against the other validation rules for profile and rule type names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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