-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
broker_ce.go
49 lines (37 loc) · 1.04 KB
/
broker_ce.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
//go:build !enterprise
package audit
import (
"context"
"fmt"
)
// brokerEnt provides extensions to the broker behavior, but not in the community edition.
type brokerEnt struct{}
func newBrokerEnt() (*brokerEnt, error) {
return &brokerEnt{}, nil
}
func (b *Broker) validateRegistrationRequest(_ Backend) error {
return nil
}
func (b *Broker) handlePipelineRegistration(backend Backend) error {
err := b.register(backend)
if err != nil {
return fmt.Errorf("unable to register device for %q: %w", backend.Name(), err)
}
return nil
}
func (b *Broker) handlePipelineDeregistration(ctx context.Context, name string) error {
return b.deregister(ctx, name)
}
// requiredSuccessThresholdSinks is the value that should be used as the success
// threshold in the eventlogger broker.
func (b *Broker) requiredSuccessThresholdSinks() int {
if len(b.backends) > 0 {
return 1
}
return 0
}
func (b *brokerEnt) handleAdditionalAudit(_ context.Context, _ *Event) error {
return nil
}