mirror of https://github.com/status-im/consul.git
Stop JWT provider from being written in non default namespace (#18325)
This commit is contained in:
parent
6ada2e05ff
commit
356b29bf35
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
mesh: **(Enterprise Only)** Require that `jwt-provider` config entries are created in the `default` namespace.
|
||||
```
|
|
@ -509,7 +509,7 @@ func (e *JWTProviderConfigEntry) Validate() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := e.validatePartition(); err != nil {
|
||||
if err := e.validatePartitionAndNamespace(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -12,9 +12,14 @@ import (
|
|||
"github.com/hashicorp/consul/acl"
|
||||
)
|
||||
|
||||
func (e *JWTProviderConfigEntry) validatePartition() error {
|
||||
func (e *JWTProviderConfigEntry) validatePartitionAndNamespace() error {
|
||||
if !acl.IsDefaultPartition(e.PartitionOrDefault()) {
|
||||
return fmt.Errorf("Partitions are an enterprise only feature")
|
||||
}
|
||||
|
||||
if acl.DefaultNamespaceName != e.NamespaceOrDefault() {
|
||||
return fmt.Errorf("Namespaces are an enterprise only feature")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue