2023-04-19 21:54:14 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-04-19 21:54:14 +00:00
|
|
|
|
|
|
|
//go:build !consulent
|
|
|
|
|
|
|
|
package structs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/hashicorp/consul/acl"
|
|
|
|
)
|
|
|
|
|
2023-07-31 13:13:16 +00:00
|
|
|
func (e *JWTProviderConfigEntry) validatePartitionAndNamespace() error {
|
2023-04-19 21:54:14 +00:00
|
|
|
if !acl.IsDefaultPartition(e.PartitionOrDefault()) {
|
|
|
|
return fmt.Errorf("Partitions are an enterprise only feature")
|
|
|
|
}
|
2023-07-31 13:13:16 +00:00
|
|
|
|
|
|
|
if acl.DefaultNamespaceName != e.NamespaceOrDefault() {
|
|
|
|
return fmt.Errorf("Namespaces are an enterprise only feature")
|
|
|
|
}
|
|
|
|
|
2023-04-19 21:54:14 +00:00
|
|
|
return nil
|
|
|
|
}
|