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