Documentation ¶
Overview ¶
Package namespaces contains logic relating to the namespacing of Rule Types and Profiles
Index ¶
- func DoesSubscriptionIDMatch(subscriptionID uuid.UUID, dbSubscriptionID uuid.NullUUID) error
- func ValidateLabelsPresence(labels []string, subscriptionID uuid.UUID) error
- func ValidateLabelsUpdate(labels, dbLabels []string) error
- func ValidateNamespacedNameRules(name string, subscriptionID uuid.UUID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoesSubscriptionIDMatch ¶
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 ¶
ValidateLabelsPresence makes sure that only profiles that belong to a subscription bundle have labels
func ValidateLabelsUpdate ¶
ValidateLabelsUpdate ensures that labels cannot be updated
func ValidateNamespacedNameRules ¶
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.