Skip to content

server: add OSS stubs supporting validation of source namespaces in service-intentions config entries #9527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9527.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
server: **(Enterprise Only)** Validate source namespaces in service-intentions config entries.
```
4 changes: 4 additions & 0 deletions agent/structs/config_entry_intentions.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ func (e *ServiceIntentionsConfigEntry) validate(legacyWrite bool) error {
return fmt.Errorf("Sources[%d].%v", i, err)
}

if err := validateSourceIntentionEnterpriseMeta(&src.EnterpriseMeta); err != nil {
return fmt.Errorf("Sources[%d].%v", i, err)
}

// Length of opaque values
if len(src.Description) > metaValueMaxLength {
return fmt.Errorf(
Expand Down
7 changes: 7 additions & 0 deletions agent/structs/config_entry_intentions_oss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build !consulent

package structs

func validateSourceIntentionEnterpriseMeta(_ *EnterpriseMeta) error {
return nil
}