2023-04-19 16:54:14 -05:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 09:12:13 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-04-19 16:54:14 -05:00
|
|
|
|
|
|
|
//go: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
|
|
|
|
}
|